An energy cooperation policy for energy harvesting wireless sensor networks (WSNs) with wireless power transfer is proposed in this paper to balance the energy at each sensor node and increase the total energy utilization ratio of the whole WSNs. Considering the unbalanced spatio-temporal properties of the energy supply across the deployment terrain of energy harvesting WSNs and the dynamic traffic load at each sensor node, the energy cooperation problem among sensor nodes is decomposed into two steps: the local energy storage at each sensor node based on its traffic load to meet its own needs; within the energy storage procedure sensor nodes with excess energy transmit a part of their energy to nodes with energy shortage through the energy trading. Inventory theory and game theory are respectively applied to solving the local energy storage problem at each sensor node and the energy trading problem among multiple sensor nodes. Numerical results show that compared with the static energy cooperation method without energy trading, the Stackelberg Model based Game we design in this paper can significantly improve the trading volume of energy thereby increasing the utilization ratio of the harvested energy which is unevenly distributed in the WSNs.