I think this will help you, with this algorytm you can not only add news layers but also delete while training, everything happens authomatically. Special Simulaton proces is runned each n epochs to find best change in structure in such a way that it wont forget what it learned. https://link.springer.com/chapter/10.1007/978-3-031-63749-0_25