President Donald Trump shouldn't be criticizing independent federal agencies like the Federal Reserve, his former top economic advisor said Thursday.

As the latest former official to speak about Trump's verbal barrage against the central bank, Gary Cohn said the president's job is to appoint the officials who make policy and then let them do their jobs.

"The Fed is doing their job as an independent agency," Cohn told CNBC's Steve Liesman during a "Halftime Report" interview.

Asked if Trump should be critiquing the Fed, Cohn replied, "I don't think he should make comments on any independent agency."

Cohn is the former director of the National Economic Council and president and chief operating officer at Goldman Sachs. He left the administration in April after several disputes with Trump, including the president's handling of racial unrest in Charlottesville, Virginia, and the tariffs the administration has enacted on imports from China and elsewhere.

On the Fed issue, Cohn expressed general agreement with the path that the central bank is taking. That's in contrast to Trump's position, which is that the Fed's steady stream of interest rate hikes poses the biggest danger to the economic boom happening under his watch.

"If you look at what's actually going on in the economy, when you look at the real numbers, we're way exceeding on growth, we're way exceeding on employment, and the Fed is basically on target," Cohn said. "It seems to be like the Fed's in a methodical rate-raising environment, exactly what they're supposed to do."

Earlier in the day, former Fed Chairman Alan Greenspan said the Fed should continue on its path regardless of White House political pressures. And former Vice Chairman Stanley Fischer warned that Trump's hectoring of the Fed could backfire by coercing it into more aggressive policy just to prove its independence.

For his part, Cohn has had a colorful relationship with Trump.

Journalist Bob Woodward's recent book, "Fear: Trump in the White House," quoted Cohn calling Trump a "professional liar." Trump recently told Fox News that he "could tell stories about [Cohn] like you wouldn't believe."

In his CNBC interview, Cohn stayed away from personal commentary about the president but did note that he continues to disagree with Trump on tariffs.

"Anything that raises the price of a good doesn't make sense for our economy," he said. "Even if they're paying it to the government as a tariff, it's just another tax."

WATCH: Here's how Trump's tweets can cost a company billions of dollars