Coresets via Bilevel Optimization for Continual Learning and Streaming