Great question.
The talkgroup affiliation-status of a roaming radio can be set by the administrator to time-out or remain indefinite. The system can also poll the radio to see if it's still online, monitoring its last-affiliated site.
Most radios DO send a deaffiliation packet (ISW) to the site controller when they shut off. Some of the more welfare radios (The LTS2000 and GTX portable) do not. They "hard shutdown".
MCS/MTS2000, XTS/XTL series, APX, ASTRO Saber/Spectra/Plus, all play nice and send deaffiliation packets upon powerdown.
If you want to affiliate a talkgroup to a particular site, but don't want to lose the affiliation status upon a powerdown (monitoring with a scanner, at work, perhaps?), simply yank the battery, then turn the power off to the radio.