That is, its members transfer part of their sovereignty to the EU
Theoretically this can change at any time with the agreement of the members.
That said: even now the UK has left, there are many in the EU who don't want total integration — as you can see from other aspects like the Euro, Schengen, and the Blue Card not applying to all member states — combined with with the language barriers between almost every pair of states[0], I think this would be a long time coming even if everyone was on board.
Although, NATO is a thing and arguably does all that without any of those problems, so perhaps it's easier than I'm assuming…
[0] Austria and Germany being an obvious exception, except they're banned by treaty from ever being combined again
In some remarkable circumstance that the EC proposed such a thing, and all the MEPs did think that was a good idea, there'd still have to be an EU treaty that allowed for it, because it's certainly beyond the scope of the CFSP. Said treaty would have to be ratified by the member states.
From a cursory read, it doesn't seem like that stands in the way: https://en.wikipedia.org/wiki/European_army
If the EU wants to have an army that serves their interests, I would consider it prudent to have the command of that army be in EU hands, instead of just handing their soldiers to the US. They can still join defensive treaties with the UK, or simply stay in NATO, but that's a different question from how the army is organized when Article 5 of NATO hasn't been triggered.
If we are to convince France to merge their army with the common EU force the EU might be forced to also protect French interests in West Africa (they are quite involved in that region still)