Yes you can. It's pretty simple actually. Here's an example using weavile and mantine:
Weavile used night slash on the foes mantine!
The foes mantine fainted!
Weavile leveled up to level 43!
Stats that leveled up when weavile leveled up
Special Attack +1
Special Defense +4
The reason why the special defense stat leveled up a lot was because the mantines best stat was special defense. Hopefully this answers your question. Hope I helped!