You don't have to learn them in classes - but the examiner must be qualified.
So.... You can download the requirements for each level from the KC site, teach them to your dogs, and you could then hire a qualified examiner as a 1:1 for an hour or so to take your tests - they do NOT have to be in a group session. Or you could get together with a couple of others to split the cost.
They do have to be taken in order though - as in, you can't take Silver without having first passed Bronze. Well-trained dogs should easily be able to do Bronze and Silver on the same day if they are good enough, although do figure in that two tests in succession might be too much work for some.
The Gold is quite a bit higher than the others, and from what I gather, is better taken separately.
I took Bronze with Merlin and passed, so joined the Silver test just afterwards and to my astonishment we passed that too - Both on the same day
However that was when he was just under a year old - his Kevination kicked in just afterwards and he became too stressed for group classes, so we did a bit of Gold training before I took him out.
He is now almost 6, and I have always thought about bringing him up to Gold standard and having a private test, but have preferred to work instead on more pressing issues such as his unreliability around other dogs, teenagers, bicycles etc. It's nice to have something on paper... but training the individual dog to its environment and smoothing off its rough edges is way more important, I feel.