An affinity for activity in a hot room should not be confused with efficacy of yoga.
The climate has nothing to do with Yoga, very little to do with flushing toxins (any more than simply sitting in a steam room), nothing at all to do with safe range of motion, and is considered a high risk for cardiac episodes for those prone to them.
You may try to ameliorate the headaches thus operating under the assumption you can exert yourself in high temperatures with no ill effects. Your teacher may be able to assist you. Hydration may assist you. Changing or modifying poses may assist you.
Or you can find a practice where you do not regularly have two-day long headaches after class.
The best advice is to listen to the whispers of your body and respond to them or they will start to yell at you until you cannot possibly ignore them.