Afaik there's no way to do this currently. What you can do is make a hidden tech, that gives you X. Since techs can only be unlocked once, you will only get the bonus once. But, you can't lose the tech. Even if you lose both thrones, or demolish them, you'd still have the bonus.
There is one more alternative, to make an improvement globally unique. But, this would not work for buildings unlocked through city level-ups. The option to select access to that building would still be there.