Degenerate Adiabatic Perturbation Theory: Foundations and Applications