A Bayesian account of generalist and specialist formation under the Active Inference framework | bioRxiv