Structural Transitions During Formation and Rehydration of Proton Conducting Polymeric Membranes