Bilevel Coreset Selection in Continual Learning: A New Formulation and Algorithm