As a Swiss citizen you remain registered with Swiss social security on a voluntary basis after relocating from Switzerland. This also applies to citizens of EU or EFTA member countries which have been registered with a Swiss social security office for at least 5 years.
The primary criteria is that you move to a country with which Switzerland does not have a bilateral social security agreement. If you sign up to make voluntary social security contributions, you will have to pay all your old-age insurance contributions yourself because your foreign employer is not obligated to match your contirbutions.