Picking transistor and base resistor to dim LED using PWM
Yes, it is necessary to limit the base current for the transistor.

First, calculate the maximum collector current for the transistor. In your case, you need to know the maximum current that each LED will draw, which depends on the forward voltage of the LEDs (which you haven't told us). Make sure this is less than the specified maximum collector current for your transistor. If not, you need a different transistor.

Look in the datasheet for the specific NPN transistor (which you haven't told us) and find the minimum current gain (\$h_{FE}\$ or \$\beta\$) at a value of collector current equal to the collector current you need.

Divide the maximum collector current by the minimum current gain, and that tells you how much base current you need. Make sure this is less than the specified maximum base current for your transistor. If not, you need a different transistor.

Given the output voltage of your MCU and the \$V_{BE}\$ of the transistor calculate a resistor value that will result in the the desired base current. Select the nearest standard resistor value that is less than the calculated value.