NIRSpec spectroscopy of pre-main sequence stars in NGC 346