Yoga Sutra II.49 “tasmin sati svasa prasvasayoh gativicchedah pranayamah”

“Pranayama is the regulation of the incoming and outgoing flow of breath with retention. It is to be practiced only after perfection in asana is attained.”
Perfection in asana is when the pose can be held fully without effort yet softly with ease of body and mind. While fully engaged in a pose enough strength should be used to be steady even when tested physically, such as someone adjusting you without your losing balance. Mental focus and concentration should also be maintained regardless of what is going on around the practitioner, such as someone losing balance or talking. When the physical and mental position is maintained and steady it is time to focus only on the breath. This is why “perfection in asana is attained” first.
During this time the ujjayi breath can be transformed into pranayama. During the inhalation the focus is on the expansion of the breath within the chest and thoracic area. During the exhalation the focus is on the changes in the body and the release of the breath. Retention can occur after inhalation, exhalation or both. The breath is both calming and energizing. The flow and movement of prana can be followed within the breath.