The problem will be if you want to charge a shaver you will have to spend 8 hours waving at the IR switch
Maybe not
Some of these illuminated mirrors turn the lights ON with the first "wave" over the sensor and then OFF with the next "wave".
As for the transformer . Buzzing suggests a loose lamination in the core is vibrating. Possible a defect at manufacture. A cure is to "boil" the transformer in hot wax to "glue" the loose lamination(s) together and thus prevent the vibration.
Or buy a good quality replacement