Not necessarily, but yes, you won’t be able to enter any league battles unless you select six to carry with you, and if you have a trainer’s license (this also applies to those registered as any of a number of trainer off-shoots, such as coordinators), there are League-enforced rules and regulations on team limits you’ll be forced to follow. Of course, if you have a trainer’s license, you’ll also have a storage system account, so the six-pokémon limit will be enforced automatically anyway.
That aside, though, even outside of League rules, it’s actually highly discouraged to carry a large number of pokémon at once. This is because the more you carry, the more difficult it is to give a pokémon the care they need. Additionally, there are certain environmental laws in place that limit the amount of impact a trainer may have on a location. For example, some parts of Alola are protected areas, which means that while trainers are welcome there, there are strict rules in place that basically state that they must leave the area (jungle, national park, wilds, and so forth) as they found it. Or in other words, you wouldn’t be able to release all your pokémon at once to feed them, as this would be considered a disruption to the natural landscape.
However, if you weren’t traveling and if you had a home of your own, this would of course be a non-issue, and so long as you can take care of all your pokémon in a humane way, there are no laws restricting the number you can have. Note of caution, however: There have been many cases of pokémon hoarders, particularly those who treat their pokémon as objects, neglect them, or raise them in fantastically unhealthy living conditions. In these cases, yes, it’s possible to have pokémon be taken away from you, but we’re assuming you’re capable of taking care of your pokémon in a humane manner here.
In short, not necessarily in legal trouble, no (although you may be in trouble for related reasons in the case of environmental and pokémon welfare laws), but all in all, it would be safer to leave your pokémon at home, to stay home with your pokémon, or to store them in the system.