I have an upper respiratory infection and gas under my ribs and anxiety and that will smother you at random times but I would visit the doctor to make sure it any life threating
No easy answer, it could be a good safety measure to discuss with your doctor. Otherwise, I think it is possible you are subconscious, holding your breath or taking several very shallow breaths. A yawn will add oxygen to your blood... I assume a mind driven couple of deep breaths would also help. I assume you can take a deep breath whenever you want too. By the I mean, in my case, a breath so deep I can feel the lungs expand beyond normal expansion.
I also sometime catch myself taking short breaths... before any SOB problem, I just notice it.