As much as we would love to believe the officer's oath (and the enlisted oath, diluted as it is by the president clause) carries water and protects us, the historical precedent of militaries says troops are loyal to their paychecks and, to a somewhat lesser extent, benefits. As long as the soldiers continue to be financially compensated, they won't rebel and will actively work against rebellions. When they stop being compensated, they'll become passive and will step aside for a rebellion. Some may even defect and join the rebellion, but only if they think its success will benefit them. Sorry to be cynical, but without a strong charismatic and revered general or admiral to follow, troops will never self-activate to "defend their oath."
Look up the fall of Samuel Doe in Liberia or the Vodka rebellion leading up to Kerensky's coup in Russia. The military is ever just hired goons. If the military were truly a circuit breaker against illegal autocracy, then they'd be doing exercises and drills to train for the day they'd have to "defend the constitution" from a domestic threat. To my knowledge, no such "uncoup the coup" drill has ever been conducted.