There are vested benefits foundations which accept non-residents who live in EU countries and therefore have to keep their vested benefits in Switzerland. In fact, unlike regular bank accounts, you can generally open a vested benefits account as a non-resident. You can also transfer your vested benefits from an old vested benefits account to a new one.
Most Swiss banks do not charge ongoing account fees for vested benefits accounts, so UBS is the exception. You can compare the costs and interest rates of vested benefits accounts using the comparison right here on moneyland.ch: https://www.moneyland.ch/en/vested-benefits-accounts-comparison
Most banks also exclude vested benefits accounts from their extra fees for non-residents. That kind of makes sense because if you live in EFTA or the EU, you have to leave your vested benefits in Switzerland. You don't have a choice.
UBS does not charge a fee when you close your account and transfer your benefits to another vested benefits account (some banks do).
I recommend that you also consider vested benefits asset management services like Viac and Finpension. You could also look at vested benefits retirement funds, which you can also compare here on moneyland.ch (just tick the "vested benefits" filter on the main comparison page): https://www.moneyland.ch/en/retirement-fund-comparison