Short version: neither the US or the EU rule the world.
Long version: Legitimate is either an internal legal question, or an external political statement.
Internally, it only matters if there is also an internal mechanism for enforcing the law.
Externally, calling another government non-legitimate is part of the process of either putting pressure on that government or providing support to a competing authority. It gives the external government justification for it's actions.
I doubt any polity has laws requiring them to take specific actions when they declare another government non-legitimate or specific processes they are required to perform for all other governments to determine their legitimacy.
While not a lawyer, I think I would have heard of a law requiring the US to determine the legitimacy of every other nation on the planet.
Basically I believe they (US and EU) can "legally" recognize anyone that they want to as the legitimate government, practically this recognition is typically given to the forces in physical control of an area. Occasionally, they recognize someone else or no one for mostly internal political reasons. For example, the US recognized Taiwan as the sole, legitimate government of China... until recognizing the PRC was more valuable in the Cold War.