Theory on Mixture-of-Experts in Continual Learning