You can do it over SSH with an awful lot of preparation and patience, however it's not for the faint of heart. I was going to go that route with my server but I first tried it in a virtual machine locally over SSH and couldn't get it to work. You can do a Google search for "centos 5 upgrade" to get some info on it.

As recommended by the developers - don't. As Voltar says, you can end up with an unbootable OS. It's really best to either migrate to a new server with the new OS already installed, or backup your accounts and then have the OS disk wiped and the new OS installed and then restore your accounts. Upgrading the Os between major versions may work, but it's not a good idea.