Multitask Battery Management with Flexible Pretraining