LPP (Pillar 2): You can transfer your vested benefits (LPP) to a different Swiss vested benefits solution, even if you do not live in Switzerland anymore. I would recommend either Valuepension or Viac. Both of these let you invest your benefits in ETF portfolios and have low asset management costs.
If you eventually move outside of the EU/EFTA, you can cash out your benefits. You can also withdraw them to purchase a primary residence, if you become self-employed, and a few other exceptions. Otherwise they are stuck in Switzerland until you reach retirement age (in which case investing them right is crucial).
Important: If your vested benefits are tied up in a permanent life insurance policy - which may be the case if they are with Swiss Life - then the terms and conditions of the policy will apply in addition to the laws governing the LPP. In this case, you will want to carefully review those T&Cs to make sure you do not lose a lot of money by terminating the vested benefits life insurance policy. If they are in a standard vested benefits account, fund, or asset management service, then this won’t be a problem.
AVS (Pillar 1): If you only have an EU passport and reside in the EU, you will not be able to withdraw your AVS benefits. This is only possible for citizens of countries which do not have social security agreements with Switzerland who reside in a country which (likewise) has no social security agreement with Switzerland.
But thanks to the tax-subsidized nature of the AVS, there really is no good reason to want to withdraw. Unless you die young, you will, in all likelihood, get much more out of it in the form of an AVS pension than you ever paid into it.