When a bulb is connected to a battery, the battery’s chemical energy is transferred into electrical energy.
When the bulb receives this electrical energy, then it converts it into light and heat energy. At first, the energy transformation takes place in the battery and then the bulb. Hence, the transformation of energy in the given situation can be shown as:
Chemical Energy → Electrical Energy → Light Energy + Heat Energy.