The NEC Requires dedicated equipment space (Clearance in front of, above, etc) but it doesnt not need to be its own room.
If you have oil filled transformers or dry type transformers over 112.5 KVA, they do not need to be a dedicated room but the room must have a fire rating.
By making it its own room there are exceptions you can sometimes take to sprinklering the room in NFPA 13.