You are most probably suffering from a hamstring tendon tear. Since you were able to continue practicing, it could be a minor tear. Your muscles were warm, but you may have been tired towards the end of your practice and therefore you lost attention. That’s why you didn’t notice the undue strain you were putting on your hamstrings (" It seemed very random."). And it would have been much better to feel the stretch primarily in the belly of the hamstring muscles, rather than at the points of attachment of the tendons to the sitting bones. Your “very intense heated” practice was too intense and there was not enough sensitivity and discernment. That’s how many yoga injuries occur. This is a lesson that many yoga practitioners, including myself, have needed to learn.
This injury needs to be given proper attention, otherwise it will happen again. A physical therapist or sports injury specialist is best equipped to advise and guide you. I am neither of these, nor have I ever pulled a hamstring.
In general, you need to rest for the first three days – no asana or exercise. Remember the RICE protocol (rest, ice – which you do not apply directly to the skin, compress and elevate)? In the following weeks, you can start to gently stretch and later strengthen the muscle. No asana practice involving the hamstrings! Gently means that you are sitting on the mat and are gently extending and bending your knee. You should not feel any pain. Or lying on your belly and doing the same. This will align and strengthen the scar tissue. After three to six weeks your healing will be complete. Months are needed for more severe injuries, but full recovery is always possible. Then you can restart asana practice involving the hamstrings. Be particularly careful with stretching in all forward bends, triangle and even downward dog because you do not want to go back to square one. Limit the feeling of stretch, duration, and repetitions. Also consider mindfully strengthening your hamstrings with bridge, (half) locust and camel. Stronger hamstrings are less likely to get injured.
In your teaching, you could ask a student to model the poses which you cannot do at the moment.
Good luck recovering.