Nutrient complexity triggers transitions between solitary and colonial growth in bacterial populations