Using analogWrite on transistor(s)

This is why electronics devices (and I mean circuits here) are usually over-engineered. Lets say you want to use a transistor to drive a standard 12V 1amp incandescent lamp as commonly found in cars. If you select a part like a 2N2222A, then you will be VERY BRIEFLY be exceeding the parts recommended ratings during the ON/OFF cycles of the PWM Signal... this is actually better than FULL ON as you would get with digital.write() since the device with full on... will "burn out faster... due to longer exposure to the exceeded parameter value... namely... MAX current of the transistor. In fact, the 2n2222 will likely die immediatly with digital.write() mode. So... use a big beefy enough transistor.

So both situations burn out the transistor... but the likelihood of the PWM driven transistor burning out before the 100% on transistor is low. The opposite is every much more likely. So the PWM impact/effect is actually opposite of what you assume.

The PWM drive technique is often used with LED's where you get HIGHER brightness, by driving the LED with HIGHER VOLTAGE and CURRENT... but with low on time PWM Duty Cycle.

The actual switching action of PWM will not degrade the transistor unless one of it's operating parameters is exceeded in doing so. An over engineered circuit, one where it's MAX parameters will not be exceeded... will not be degraded by PWM activity. So design the circuit so the transistor is not abused... and the switching is safe. MANY transistors can continuously switch at speeds close to 300MHZ... so what are a few kilohertz going to do? (Hint: very little)