During battle when you attack with either your main weapon, ranged weapon, or special attack, there will be a flash. When you see this flash, press either A or X to perform a perfect attack. The screen will also tell you on screen when you perform a ervect attack. I wouldn't reccomend grinding this as you will most likely get this naturally.