I believe the answer is: in Article 1 of the Constitution
The article 1 of the constitution write around 27 of the congress' expressed powers, including make laws governing those armed forces. The armed forces' case is handled in a special court called the military court, which only handled current or ex military personnel.