Let's start with the military.
Do you see the Joint Chiefs of Staff, along with the 5 star generals in every force, going along with an unlawful attempt to hold onto power?
Barr is Trump's lapdog, but do you see the head and rank of the FBI, DEA, Marshals, ATF, and other federal law enforcement agencies going along with this?
Now to the states... What governor do you see going along with an unlawful hijack attempt? Any attempt at federalization of state national guards would be struck down by any state or federal court. In addition local and state law enforcement report to governors, not the president.
So in such a scenario... Who does Trump have to prevent a peaceful transfer of power?