In this paper, we consider an energy harvesting cognitive radio network (EH-CRN), where a primary and a secondary user coexist in underlay mode. Both the transmitters have energy harvesting capability and are equipped with finite capacity battery to store the harvested energy. In addition, the secondary user (SU) has an independent energy transfer unit such that it can transfer some portion of it's harvested energy to the primary user (PU). We obtain an optimal transmit power and energy transfer policy for single-slot and a suboptimal policy for multi-slot scenario maximizing the number of bits transmitted by SU under the primary sum-rate constraint in an offline setting. For both cases, the effect of energy cooperation on the system performance is studied and it is observed that energy cooperation results in higher SU throughput.