Nuclear magnetic resonance study of expanded lattice permanent magnet nitrides and carbides at high pressure