A dynamic neural resource model bridges sensory and working memory