The discovery could lead to a new treatment for millions of people with both obesity and type 2 diabetes