Fan Control Theory

You are supposed to drive the fan PWM pin from an open-collector output, i.e. you can pull it low but not high. With a direct connection to the Arduino, you could achieve that using software PWM but not using hardware PWM. However, you could connect a small signal diode (preferably Schottky) between the Arduino pin (cathode) and fan PWM pin (anode) instead of using a transistor.

One other thing to consider is what happens if the Arduino is powered off but the fan is powered up. With a direct or diode connection, the fan will run at minimum speed, which may not be a safe condition. Using a transistor or mosfet, the fan will run at maximum speed.