An abstract Logvinenko-Sereda type theorem for spectral subspaces