Being a stealth jet doesn’t mean you can’t accommodate this problem when training. The F-35 already has radar reflectors which increase radar signature to obscure stealth properties during peace time, having a beacon on top of that isn’t that absurd.
They absolutely do have beacons, called transponders, similar to what civilian aircraft have. Of course they can be turned off in a military jet.
The article says the transponder was not functioning because of the electrical malfunction