A transformer is made up of two coils of wire. The primary side and the secondary side. There are no other electrical components inside a transformer. The only way a coil of wire can get hot is that too much electrical current passes through the wires.
Once in a great while, the windings inside the transformer can short out causing too much current to flow through the other wires, but that kind of internal short would probably burn out the fuse, or blow the circuit breaker.
The original problem that caused the transformer to get too hot is usually a problem inside the power supply itself, or a problem in the building's wiring connected to the output of the power supply.
Building Wiring Fault
Most fire alarm or security power supplies have protective circuitry inside to prevent damage to the power supply should there be a short circuit in the building's wiring. Unless there's a pre-existing problem in the power supply, the power to the building's wiring would be cut off before damage to the power supply.
Power Supply Fault
Components on the power supply circuit board is the most likely cause of the transformer being too hot. Replacing the transformer would not fix the power supply. Even though the transformer was replaced, the power supply probably needs to be replaced.
When powering up the new power supply, watch out for faults in the building's wiring. That possibly is the original cause of burning out the power supply, which made the transformer too hot.
There probably isn't a fault with the building's wiring, but keep that in mind when powering up the new power supply.
If there's batteries in the power supply, don't reuse the old batteries. Batteries are inexpensive, regularly have to be replaced anyway, and once they've been drained all the way down, they won't have the capacity to hold as long as before. You're spending a lot of money on a power supply, just spend the little bit extra for new batteries. Then you will know that the old batteries weren't the original cause of problems.
To answer your original question, taking out the transformer probably isn't the cause of the power supply going bad.