They didn't. The EU Parliament and the Commission could make laws directly binding on British citizens even if the British government opposed them. That's not sovereignty.
And the U.S. federal government has only the powers devolved to it by the sovereign states. But its hard to say U.S. states retain any meaningful sovereignty today.
But US States can't leave the union (although they can change the constitution).