Phase transformation of BN in the solid state during electrostatic deposition