Can a doorbell transformer that is on the outside of a wall be place inside the wall behind the drywall. I’m concerned about it getting too hot. Mine is in the kitchen by the ceiling lights
The door bell transformer is mounted to a mains electrical box. Electrical code requires that all electrical boxes remain accessible. You cannot bury or hide an electrical box.
This translates to the fact that you cannot cover the electrical box + transformer behind drywall.