The prisoners will only attend classes and want to further themselves if they are not suppressed.
From the Dev Wiki:
Most programs are voluntary, but prisoners will be less likely to volunteer for programs if they are badly treated
Some things that help with this is not having armed guards around as that will automatically suppress any prisoner around. However, you can have as many regular guards as you want as that does not affect suppression.
Another thing you can do is make them have the status of "Well Fed" which is where you serve high quality, high quantity food.
From Alpha 12:
Suppressed: Prisoners locked in Solitary Confinement will become suppressed and compliant due to their harsh treatment. These suppressed prisoners are much less likely to cause trouble.
Well Fed: Prisoners who eat well will become "well fed", contributing to the good feeling in the prison.
Well fed prisoners are much less likely to cause trouble.