I've worked past the point that my access started expiring and I had to make sure not to reboot anything important so I could keep making progress, even after they came and took my chair away [yes, seriously]. When I absolutely had to reboot the dev system to continue, I sent off my final notes and left.
I do agree that knowledge transfer is top priority, but sometimes there's also work I'd really like to hand off in a completed, easy-to-take-on state, that will save the next engineer ever more time than another few hours of brain dump.
Still, try to do the brain dump first.
Even after all that, I still got a panicky call a couple weeks ago about a project that hadn't been touched in over a year. You can only go back so far :-)
The employer before that, it was $200/hour and they were happy to pay it.