Do you have a heatsink on it ?
What is your measured voltage across the input pins when your motorcycle is running ?
What is the output current ?
Have you got filter capacitors on the input and output ?
What is the ambient temperature ?
If you are using a heatsink, what size is it ?
Is there any airflow around the heatsink ?
while traveling if the headlight is OFF during day time , the voltage at the battery terminals would be almost 14V. Think that you are trying to draw 200mA approx. The difference is 7V and current is 0.2 A, hence 3.5watts is wasted across 7805 which causes the heat. Better follow the suggestion given by Picbits by providing a suitable heatsink.
while traveling if the headlight is OFF during day time , it means ic7805 drive on more current .One thing you can do - one low value resistance approximatly 10 ohm 1- 2 watt, added in series with input terminal of LM7805 ic as well as providing heat sink to the IC LM7805. and insure cooling of charger should be there.
Try the black regulator, 5V 200mA output, 88% efficient so no heatsink required and probably costs the same or less than the LM7805 plus capacitors and heatsink. Official Home Page of Roman Black