IIRC selfish mining is mining without broadcasting the blocks. Some pools do it for only a short time to get a headstart on mining the next block, the obvious risk being someone else broadcasts a block before you do and your block becomes orphaned. In the case of a 51% attack, I believe you can simply selfish mine then reorg the chain every now and then because your chain is longer. This way, you mine every single block.