I would suggest you need an oscilloscope to see what is happening.
If you are trying to run a motor on PWM, you need a freewheel diode across the motor. It should be a schottky diode for fast switching. Without it, the transistor is likely to fail.
The inductance of the motor should keep the current largely constant, so you would expect the current to flow in the transistor for more of the time at high speed. The current will be approximately proportional to the load torque, and without knowing what the load is, I have no idea how that will change with speed. However the load torque, and therefore current, is unlikely to increase at low speed, so the current will be no more at low speeds, and the reduced on-time for the transistor means that there should be less heat.
The fact that the transistor gets hotter at low speeds makes me think that there is more current at low speed. That could be because the PWM speed is too low, and the transistor is on for too long and the current has time to build up to near the stall current. That could take the transistor out of saturation, which will result in huge amounts of heat.