Two-dimensional phase transformation in grain boundaries