If you upgrade the golden age weapon with the jewel still inside, then the jewel is destroyed and the sentient XP is lost.
If you remove the jewel before doing the upgrade, then you plug the jewel into the new weapon and nothing is lost except the sentient tool(s) that you used to remove the jewel and any filigrees you wanted to save.