Typically all transformers make some noise when operating. That being said what brand transformer did you buy? Some cheaper transformers can be noisy. Without the transformer mounted to the panel is it still “buzzing”. Often times when placed in the knockout it can vibrate on the panel itself. Make sure the set screw is also tight and firmly in the knockout.