The formation and transformation of local institutions within a community-based natural resources management framework in the context of transition: comparative case studies in Northern Thailand and Yunnan, China