By definition, the military in a coup can do whatever it wants. It is the suspension of civil law. In this case it would be a result of the breakdown of actual law. The trick is restoring the rule of law after. Very dangerous to go that route, but we may be at that point, and Trump is the last chance to keep things from going that way.
Look at it another way, if the Republic is under threat he declares Marshall law and then the SHTF
Habeas Corpus is suspended and then all the rats will scatter like roaches as at that point we are taking down a treasonous conspiracy and hangings and firing squads come into play. Military tribunals, not sure if you have seen how many military officers have been called back to duty, they would be the onces conducting the trials in that scenario