Some people do them both around the same time, transfer and brew another batch.
I should say that I don't know the CORRECT answer to your question. The trick is to keep it from getting contaminated.
However, my next comments are sure to raise some controversy:
Depending on how clean the trub is (the cleaner the better), with or without hop residue (hop residue adds bitterness to your next batch), I always try to bottle some of the yeast for re-use. Most of the time I get about 3 - 0,5 liter bottles from a primary. I've also poured all of it into a sanitized growler to use later. The smaller bottles fit in the fridge better, about 12-15 per shelf.
If I were to transfer to the secondary and wanted to reuse my yeast I would leave a couple of inches of the beer on top of the yeast cake, recap the primary, and fill the airlock with water so it wouldn't get contaminated. I'm sure it could probably last a relatively long time, 1-2 weeks, before I'd change my mind about using it.
As long as the yeast stays covered (water/beer) I would feel pretty confident in reusing it.
Afterall, except for the sanitized environment, that's what's in a vial isn't it?