Meta-Learning and Synthetic Data for Automated Pretraining and Finetuning