Prince Charles has spoken of how his grandmother sheltering a Jewish family during the Shoah helped inspire his work with all faiths – as he warned that the lessons of the Second World War were in “increasing danger” of being forgotten.

The heir to the throne was speaking to hundreds of supporters of World Jewish Relief at the charity’s annual dinner at the Guildhall on Monday night.

In a passionate address, he said: “The work of World Jewish Relief allows us to rally together to do what we can to support people practically, emotionally and spiritually, particularly at a time when the horrific lessons of the last war seem to be in increasing danger of being forgotten” [a comment seen by some in the room as thinly-veiled criticism of Donald Trump].

He referred to the charity’s work with impoverished Jews in Ukraine as well as with those fleeing the horrors of Syria and agricultural entrepreneurs in Rwanda – a country that has also suffered genocide. “In reaching beyond your own community you set an example for us all of true compassion and friendship,” said the prince, who is a patron of WJR.

The man who famously said he wants to be “defender of faith” told the audience how religion “empowers” rather than limits.

And, striking a strongly personal tone, he suggested his own and his family’s links with the Jewish community have helped inspire his own efforts to reach across communities.

He specifically referred to Princess Alice’s work in sheltering a Jewish family during the War, for which she was recognised as Righteous Among the Nations, and his attendance in the 1960s at a school where he was taught by Jewish immigrants. “I’ve not forgotten their wisdom and dignity,” he said.

He also took the opportunity to hail Holocaust survivor Ben Helfgott, saying he showed the “extraordinary grace and strength you’d expect from someone who captained the British weightlifting team at the Olympics. To me Ben and others like him who have endured persecution are a reminder of the danger of forgetting lessons of the past.”

The prince’s association with the charity dates back more than a decade and it was his meetings with survivors in Krakow that inspired WJR to establish a community centre in the city, which Charles opened in 2008.

He said he had always been “drawn” to the charity by its efforts to help beyond the Jewish community.

Charles added it was all about “doing things not just talking about them, about supporting local communities and not imposing solutions from outside. Not just supporting those from your own community but people irrespective of faith”.

He concluded: “I could not be more delighted by my long association with World Jewish Relief.”

The dinner was hosted by Emily Maitlis and other speakers included the Chief Rabbi and honorary president Nigel Layton. The latter said prince Charles had “enabled a modern day miracle” with his idea for a community centre that now board more than 600 members.

In a video message, comedian James Corden joked that he is inundated with requests to do address Jewish charity dinners. The Jewish community, he said, “love charity and they love dinner. What next… the Jewish pet society?” He agreed to do the message after being told it would make his mother “kvell”.