Fastening of transformers or ballasts