Exploring the dynamic interplay between learning and working memory within various cognitive contexts