Doorbell Transformer inside panel

What is a class 2 and why can’t they occupy the same enclosure as power conductors?