There are specific swimming exercises you can do, as part of a routine, that build lung capacity.
(Results may not generalize. It worked for me.)