Liberal democracy and free market capitalism are under threat unless governments do more to tackle inequality, the US Treasury secretary has warned on a visit to the UK.

Jack Lew called for Britain and the EU to ensure their economies remain “highly integrated” when Britain leaves the bloc. He linked the vote for Brexit to a more general rise in anxiety among people over how economies have evolved and the “lopsided” nature of gains.

With just over a week to go to the US presidential election and against the backdrop of a tight race between Hillary Clinton and Donald Trump, Lew told an audience in Oxford that populism was on the rise in many countries, calling it “a challenge in so many parts of the world right now”.

Lew told the Oxford Union debating society: “Clearly it was an issue during the vote here and the decision whether or not to remain part of the European Union. It’s clearly a part of the elections taking place in the United States this year. And if you look around in Europe, it’s part of elections in so many countries in Europe.”

He said people’s worries about their economic situation and economic prospects stemmed from many sources, including technological changes and globalisation.

“In the United States – and I would hazard to say that this is true here in the vote for Brexit – there is some anxiety that flows from the way that the modern economy has evolved that is looking for a solution,” he said.

“Why don’t people feel good? They are looking at an economy that increasingly seems lopsided,” he added, saying many workers who paid tax felt wronged by what they saw as a business tax system where “on the international side you see a whole lot of international firms organising themselves to avoid paying in some cases any taxes”.

The onus was on government to reform the tax system, to increase investment in people so that they have the right education and skills for the modern workplace and to spend on infrastructure, according to Lew, who has served as Treasury secretary under the US president, Barack Obama, since 2013 after a stint as White House chief of staff.

Without such moves, he predicted drastic long-term consequences. “We run the real risk that middle class, working class people say, ‘I see the economy is growing but I don’t see how I am going to benefit from it.’ The danger, if that is where things drift to, is not just a short-term political one, I actually think it’s a fundamental threat to liberal democracy and to free-market capitalism.”

Without referring specifically to Trump and his proposal to build a wall between the US and Mexico, Lew also addressed rising concerns among voters over immigration.

“We have a history [in the US] of ‘everyone should have an opportunity’, and you look at the way the modern economy has evolved and people are beginning to question that proposition.

“When people question that proposition they lash out and historically one of the places people lash out is against outsiders. And I don’t think it’s a surprise to see that when people are anxious they lash out on issues like immigration. But the answer is not to put up borders that are impermeable … but it’s also not to ignore the anxieties,” Lew told his audience in Oxford.

Touching on a debate at the heart of the UK’s referendum battle, when pro-Brexit MP Michael Gove remarked “people in this country have had enough of experts”, Lew also raised concerns about widespread scepticism over fact-based analysis.

“I fear that there is a growing distrust of authorities in general … The alternative to relying on expert analysis is making decisions more emotionally and that worries me,” he said.

He also championed US efforts to strike free trade deals but said politicians had a responsibility to convey to people how those trade deals were improving economic growth and living standards. Barriers, on the other hand, hindered economic growth, he added, in another apparent dig at Trump’s protectionist policies.

Lew also congratulated himself and his administration for progress made on shoring up financial stability since the global crisis.

He said conversations with big banks in the week after the Brexit vote showed him that moves to build up capital and readiness to deal with shocks was paying dividends. But he stressed that the fact the global economy had been able to withstand shocks like the referendum should not lead to complacency.

“We should never take our eye off the ball in terms of asking what is the threat of the future … False complacency is a thing to worry about,” he said.

Earlier on Monday, Lew met bank bosses in London. Following the discussions, his spokeswoman relayed his pleas for an orderly Brexit process. “The secretary reiterated that a transparent, smooth and cooperative process that results in a highly integrated economic relationship is in the best interests of Europe, the United States, and the global economy,” she said.