The thing is, while considering will my transistors be able to dissipate those powers without burning themselves, which value of the powers should I use?
Before considering Safe Operating Area and transient thermal impedance, first look at average power, here it is 1W. If average power is enough to make the smoke come out, there's no need to check the other conditions.
Check transistor datasheet, it specifies maximum disipated power of 1.2W at Tc=25°C.
"Maximum dissipated power" as specified in a datasheet is not exactly what it says, because it implies that the case is cooled by a perfect heatsink of infinite size which magically holds the case at 25°C. This ain't gonna happen in the real world. Unless maybe you dip it in liquid HCFC coolant or something.
"Maximum dissipated power" is useful for comparing transistors, but it doesn't tell you how much your transistor will be able to ... dissipate ... in real world conditions, with a real heat sink, inside an enclosure that may be hot, maybe with low airflow, dust, cat hair clogging the vents, etc.
In this case, your problem is that 2N2222 is a low-power transistor, which means its silicon chip is quite small, so it will have a small contact area to the metal case, and the case is also small and not designed to transfer heat efficiently. This explains the enormous ThetaJC, or Thermal Resistance Junction To Case, of 97°C/W. This means with one watt average the chip will be 97°C hotter than the case. And you won't be able to keep the case at 25°C, so your transistor will burn.
This huge ThetaJC comes from the way the TO18 package is constructed. Consider the long and complicated path heat has to travel to get from the chip to the case... This is a very old package...
So you need a transistor with better heat transfer between the chip and the case. For example, a SOT89.
In this package, the chip is mounted on the large copper slug in the middle, which is directly exposed, so you get a "Thermal Resistance, Junction to Leads" of about 5-10 °C/W, which is way better than 97°C/W. You still have to cool the center lead by using PCB copper area as a heat sink, but at least if you keep it cool, the chip will not be 100°C hotter than the leads as in the 2N2222 case. It will only be 5-10°C hotter than the center lead if it dissipates 1W. This is how, with proper heat sinking, a tiny SMD package can safely dissipate a lot more power than a TO18.
If you make a push-pull emitter follower with your transistors, the center pad will be the collector, that is the supply voltages, which is nice because you can add copper area for cooling.
Likewise TO220 has good thermal resistance junction to case because the chip is soldered on a copper slug, and heat travels through in the correct direction (depth-wise through a large cross-section area of copper) and not in the bad direction (lengthwise through a thin metal plate).
In your case, for your average power, I'd go with SOT89 transistors in SMD if space is tight, but that would be pushing it a bit. Most likely DPAK. If you want to prototype it, use TO220 or TO126 transistors and a small heatsink. Even a very small clip-on heatsink will do. Or a TO220 with no heatsink at all, but you will burn your fingers. When prototyping, it is always nice to not burn fingers.
The important thing to remember is that temperature difference between case (or heatsink) and air helps cooling because it moves air by convection. However, temperature difference between chip and case does not help at all, it is a part of your thermal budget that you spend but it does not help cooling. This is why manufacturers optimize packages for low RthJC.
Once you have picked a transistor and package that can safely handle the average power, then you will have to check safe operating area and transient thermal impedance.