Role of quantum coherence in the thermodynamics of energy transfer