After when you beat Cheren heading to the Cave that leads to the 7th Gym, the person that talks to you gives it to you.