It's wonderful to hear that your cat is providing you with comfort during moments of anxiety. While cats may not be "trained" in the way we typically think of training dogs, they are highly attuned to their human companions and can pick up on emotional cues and changes in their behavior.
There are a few possible reasons why your cat may react this way when you're having an anxiety attack or hyperventilating:
Empathy: Cats have an extraordinary ability to sense changes in their human's emotions. When you are feeling anxious or distressed, your body language, scent, and even the sound of your breathing might change, and your cat can detect these subtle cues. Cats have been known to respond to their owners' distress with comforting behavior as a display of empathy.
Social Bond: Cats form strong emotional bonds with their human caregivers. They view you as part of their social group and may feel compelled to provide comfort and support when they sense you are upset or in distress.
Soothing Behavior: Licking is a behavior that cats often use to groom themselves and other cats in their social group. By licking your face, your cat might be trying to soothe you in a way they would comfort another cat.
Attention-Seeking: During moments of anxiety or distress, your cat may notice that you are giving extra attention to your own feelings and may want to be closer to you to seek comfort and reassurance.
Remember that every cat has a unique personality and may respond to their human's emotions in different ways. Some cats may be more affectionate and intuitive, while others may not exhibit the same behaviors. In any case, having a supportive and understanding furry companion like your cat can be incredibly beneficial for your well-being during difficult times.