It is not a coup until and unless he fails to abide by a SCOTUS judgement. If that happens, the military will have a decision to make. Do they act then or do they wait until he issues an unlawful order. Pete Hegseth, as SOD, will have little to no influence in their decision.
The first thing that would likely happen is that Democrats and some Republicans would call for his impeachment and eventual conviction. At this point, Trump's militia would start acting up, there would be protests in the streets and Trump would declare martial law to quell the disturbances. It won't be until Trump issues what the military considers to be an unlawful order that they would take action. If he did issue such an order, what action(s) could the military take? 1) The general(s) could resign rather than follow the order(s); 2) They could refuse to obey an unlawful order(s) and NOT resign; 3) They could order his arrest and have him court martialed. If generals resign in sufficient numbers, it's going to be obvious to the general(s) next in line that something bold (i.e. arrest and court martial) has to take place.
The generals know that they would be court martialed if they resign and Trump stays in office. It is for that reason that I don't think that many would resign. I think they would act to have him court martialed rather than wait to them to be court martialed. The real question is what would the chain of command and soldiers do? Do they follow their CIC or do they follow their chain of command? Hmm...
The dems, especially those in the senate, like to claim that they're doing all that they can to stop Trump/Musk. They are putting on a show but that's all their actions amount to. So far, only one dem, Brian Schatz, has said that he will pull a Tuberville and hold up some of Trump's State Department nominees. Trump has recently decapitated the military leadership of the Pentagon and will have to nominate replacements. More democrat(s) need to step up and pull a Tuberville and prevent those nominations from moving forward.