This is risky and can cause corruption. Safest bet is to keep separate installs/launchers for modded vs vanilla and don't transfer saves between them.