He might be getting hypoxic (low oxygen
) during strenuous exertion of swimming.
some evaluation is required of your child.like
chest X ray
to rule out any lung pathology/Cardiac size etc
vitals like Blood pressure and Heart rate
And if do not find any thing with these investigation then one should go for imaging of Brain.
Better you consult any pediatrician
directly for all these.