You can gain EVs, which will increase a stat. There are a few ways to get EVs without getting any experience.
Use the Protein item. They give 10 EVs and will only work for the first 100 EVs. This method is costly, though. Each one costs 9,800 in-game currency.
Send a Pokémon to the Island Aphun in Poké Pelago (only in SM/USUM) and choose the Attack course. This is nice for training multiple Pokémon at the same time or for training without any effort. All you have to do is select the course and wait.
If your Pokémon is level 100 and isn’t fully EV trained, any battles it is in will increase a stat but won’t give any experience (because it can’t level up).
If you don’t know what EVs are, I recommend that you read about them here.