Energy transport and heat production in quantum engines