This problem could be mysql problem.
Start by moving mysql data files to your second hard drive.
If you don't know how to do this, take backup, uninstall mysql and reinstall it on the second hard drive (during the installation, installer will ask you where and you will have to set it on the second hard drive.
Since you say that this happens on the class change (where also skills are given I guess), where a lot of SQL queries run, this is your best bet. I can also guess that this lag also happens on subclass change (where you will have stackskill exploits if so).
Try what I suggest, its the simplest and you should have done this already. Then I can help you optimize your mysql config.