Dimensional transformation of chemical bonding during crystallization in a layered chalcogenide material