how does a territory become a state