This paper presents a hierarchical transactive energy management framework for a residential microgrid to share excess energy of prosumers with neighbors. A three-level hierarchical structure is proposed in this paper which facilitates energy management in different houses, energy sharing and transactions among neighbors and with the grid. The priority of sharing energy among different houses in a microgrid as well as with the grid is set in such a way that the houses, which have their own generation, will first fulfill their own demand. The power sharing among different houses demonstrates that there are some savings in electricity for a certain period. A generalized cost-benefit analysis framework has been developed by considering different tariff structures (flat rate and feed-in tariff) to assess the financial benefits of patrons to be involved in energy sharing projects. Results from the analysis demonstrate that with the ever decreasing feed-in tariff in Australia, not only the prosumers but the residents without renewable energy sources and energy storage systems can be benefitted through the proposed transactive energy management scheme.