The resistor shouldn't be less than 140 ohms to protect the Pi, and the fan shouldn't draw more than 800mA to protect the transistor.
I got those figures from the 2N2222A data sheet.
Ic max = 800mA
At Ic = 500mA and Ib = 50mA, HFE min = 30, Vce max = 1v, and Vbe max = 2v
At Ic = 150mA and Ib = 15mA, Vce max = 0.3v, and Vbe max = 1.2v
140 ohms, with the GPIO at 3v3 and the transistor base at 1v2, takes 15mA from the GPIO into the base.
The transistor should then be able to supply 30 times that current, or 450mA.
If your fan wants more than that, choose a different transistor!