What I do, when I ferment in a keg and harvest, is have my liquid tube bent a tad so it sits off the bottom of the keg a couple inches. This will leave behind a 1/4 to 1/2 gallon, which should be plenty for most beers to leave trub and yeast behind. After the closed transfer is complete, I'll swirl the keg and pour off the yeast into jars. Just sanitize the outside of the keg really well before pouring off into jars.
And Narcout already covered it. All you need is a gas disconnect with a piece of tubing going into a jar of sanitizer for blow off.
You don't want to ferment, say, 4.75 gallons of a Belgian blond in a keg though. It will clog the blow off and you'll have a serious mess on your hands. Ask me how I know this...