It is the same as anywhere else unless you use an escrow service. You receive the payment and you transfer the domain and however you agreed to transfer the site. Some people offer to transfer to the new server for the buyer, some allow access to the cpanel for the buyer to do it himself , and some just transfer the files.
I would suggest using an escrow service in case of transferring domain names..its safer but not exactly cheaper..
Yes i have do this before and its is secure. It work this way,after you received money from buyer. You transfer the domain to buyer domain registrar. Copy your website file then sent it to buyer email. And that all.Its easy