how to wire NPN to switch DHT22 temperature humidity sensor on arduino
I know it doesn't fully answer the question about using a transistor, but you can simply power the sensor from an MCU pin.

The datasheet says it draws only 40 uA in standby, which might not matter anyway, and only 1.5 mA max during measurement. Many microcontrollers will be able to drive that.

The only thing to be careful of is that your software doesn't assert the data line, before powering the sensor. You might have to modify the standard libraries to force the data pin to high impedance when you're done measuring.

This is a useful trick to save parts and save power on a microcontroller. Try to power the small or parasitic loads from the micro's output pins if they're not needed all the time. Things like the red power LED, the high side of a potentiometer for a user knob, pull-up for opto-isolators and the peripherals can go through the micro. You need to respect its current limits, total and per pin (and you can't safely put pins in parallel).