Who generates the coinbase transaction?
The coinbase transaction is not relayed by the network. It is invalid except as the first transaction in a block.

A standalone miner generates the coinbase transaction itself. 

In mining pools, the mining pool generates the coinbase, and sends it to the mining client.