What could be the reason that this transistor gets too hot unexpectedly?
How to know if you need a heatsink. (Apart from the burnt finger).

This is well covered in engineering textbooks and courses. And websites such as this. 

In short : 

You know the power dissipation, and the ambient temperature where this lives. Let's say, 1W, and 40C.

You decide what temperature you want to restrict the junction to : below 100C, lets say 90C for a safety margin. 

From the Junction-Case thermal resistance (10C/W) and the power (1W), that gives a case temp of 80C (or 40C above ambient).

Which means we need 40C/watt between case and air.
(If the 62K/W figure is correct for a SOT32 package ... google it ... you need a heatsink.

So we look for a heatsink with 40C/watt or better, thermal resistance.

(This is slightly simplified to illustrate the principle, but good enough for this application. For more detailed thermal budgeting, see e.g. the website above)



Damage can take microseconds to years, depending on the degree of overheating.