If you plan to retire in Foshan in the future, you will transfer Guangzhou's social security to Foshan to continue to pay. If you don't plan to retire in Foshan, you don't need to transfer Foshan's social security to Guangzhou before retirement. You can also call the unified service hotline 12333 to consult the local social security center.
Further reading: How to buy insurance, which is good, and teach you how to avoid these "pits" of insurance.