In the datasheet you will see the packages thermal chatacteristics:
You can see that for the SOT-23 package, for every watt the junction temperature rises by 357°C above ambient. The maximum dissipation (without a heat sink) is also given as 350mW (for an ambient of 25°C)
We can see why the 350mW is given:
357 * 0.35 = 124.95°C - the maximum temperature is given as 150°C, so this makes sense as if the ambient is 25°C the junction will be at 150°C.
To work out your dissipation, simply multiply the voltage across your transistor with the current through it (if it changes, then look at the worst case)
In your circuit, it seems you are using the transistor as a switch, so it will be turned fully on. When fully on it will have a collector-emitter voltage of ~0.3V, so if it's passing 50mA then 0.3V * 0.050 = 15mW, pretty safely within limits.
At 15mW your junction will rise by 357 * 0.015 = 5.35°C above the ambient, so you can have a maximum ambient temperature of 150°C - 5.35°C = ~145°C. Really it's better to spec for 125°C as 150 is the absolute maximum rating, but this still gives you 120°C, so you should have no problems at all.
Take note of the small print that mentions how the device is mounted to achieve the temperature specs (for future reference, in this case it doesn't matter, but sometimes a large ground plane is needed)
Here's a basic introduction for future use on heatsink basics and thermal design.