Structural transformations of metal alloys under electrocatalytic conditions