Mechanism of an epigenetic switch that mediates neural development