The only way to find out if the order is truly illegal is to obey or refuse and let a military court decide after the fact. You obey or disobey at your own peril which is one of the risks of enlistment.
Otherwise this…
Article 90 — Willful disobedience of a superior commissioned officer
Article 91 — Insubordinate conduct toward a warrant officer, NCO, or petty officer
Article 92 — Failure to obey order or regulation
Article 94 — Mutiny or sedition
