Military aircraft have controls on their dashboards for turning individual systems off as required. Turning off ADS-B would be the first thing on the checklist for sensitive flights, and one of the things that are turned on purposefully when entering friendly airspace.
It would surprise me if military transponders do not have the ability to broadcast “I am a Cessna at 3000ft” regardless whether the actual aircraft is a F35 or a Galaxy.
cf the usual copypasta about the SR-71 crew asking ATC for an altitude and speed reading. They use the broadcast radio systems because they want you to know they’re there.