"Legitimate" would be in the eye of the beholder I suppose. A monarchy is legitimate in those nations that have one. A dictatorship or other authoritarian government is legitimate when the dictator and/or the regime have the sole power to declare whether the government is or is not legitimate.
Is the U.S. government legitimate when all three branches have strayed so far from their constitutional authority? The Founders would almost certainly would declare a resounding NO. Teddy Roosevelt, who turned the Constitution on its head with his declaration that the government could do whatever the Constitution did not specifically forbid, and most of the more authoritarian Presidents since then, would probably say yes.
IMO, the U.S. government is not legitimate in anything that it does beyond the authority given it in the Constitution.
Presidents should not be allowed to make law. They do that these days and that is not legitimate. Certainly a President should not be able to overturn or change or refuse to enforce any law that was passed by Congress and a President signed.
Congress should make only laws to fulfill is constitutional authority and should be responsible for passing and/or changing and/or abolishing ALL laws, rules, regulations that bind the federal government, the states, and/or the people in any manner whatsoever including the use of their tax dollars.
The bureaucracy should respect, comply with, do, and/or enforce only programs, laws, rules, regulations that are passed by Congress. Unelected faceless bureaucrats should have no power to create and/or enforce any rule, law, regulation to which the people are required to obey.
The courts should interpret the existing law, advise Congress if there is a constitutional issue with any law passed, and settle disputes of proper application of the existing law when there is disagreement. Unelected judges should have no power to issue any ruling that constitutes a change in a valid law passed by Congress or create a new one thereby bypassing the people's elected representatives.