Any commissioned officer who uses contemptuous words against the President, the Vice President, Congress, the Secretary of Defense, the Secretary of a military department, the Secretary of Transportation, or the Governor or legislature of any State, Territory, Commonwealth, or possession in which he is on duty or present shall be punished as a court-martial may direct.
Just because an Officer retires does not mean he looses his Commission.
If the Officer should resign his Commission he receives no pay and allowances and is not longer subject to the UCMJ.
A Commissioned or Warrant Officer can't just quit and walk away. They have to apply and the particular service has the final say.
It has been 45 years since I served but I do believe Article 88 is the same today as it was back then.
I remember how shocked my civilian friends were when they found out that one essentially abrogates there 1st Amendment Rights when the swear the "Oath".
Otherwise they'd be slaves.