Exempting the UK from ever closer union is political rather than legal
As the phrase "ever closer union" is to be found in the EU treaties themselves, amending or deleting it would require every country to agree.
Instead, the UK could be formally exempted from the aspiration to ever closer union, which could be confirmed by treaty change down the line.
Thats just what the EU deal does:
It is recognised that the United Kingdom, in the light of the specific situation it has under the Treaties, is not committed to further political integration into the European Union. The substance of this will be incorporated into the Treaties at the time of their next revision in accordance with the relevant provisions of the Treaties and the respective constitutional requirements of the Member States, so as to make it clear that the references to ever closer union do not apply to the United Kingdom
Whats actually achieved by this?
Given the fact that the phrase ever closer union doesnt imply a move to a federal EU, and isnt a legal basis for any increase of EU power, exonerating the UK from a commitment to achieving ever closer union will not change the UKs relationship with the EU.