Each block has a coingen transaction for the block subsidy - so far so good.
But how does the miner gets the fees of transactions in a block?
Exactly the same way.
The "coingen transaction" of the block doesn't
only have the block subsidy. It has the block subsidy
+ the transaction fees.
Is there a "getTransactionFees()" transaction?
Nope. Just the "coingen transaction"