You're thinking on the right track, but honestly they already replaced all the top brass with stooges and forced most of the officer who had principles to resign. I would not count on the military intervening if trump declares himself emperor for life.
We still need to vote, of course. But if he ignores the results, or if they fuck with the elections too hard to ignore, don't expect salvation to come from above...