It’s worth learning because it will be in the market for the next decade, but Adobe believes Edge Delivery Services is the future of AEM and has actively started building that out and migrating customers to it. EDS with Universal Editor still expects AEM for content persistence so expertise is important in the foreseeable future even as they sunset it.
The virtue of learning AEM is that it, in essence, is an Ingres to more modern headless development by way of SPAs, Universal Editor, and even EDS which is analogous to gitflow-driven static site generation while still giving you enough pain and frustration to teach you about traditional monolith development.
There are probably easier paths, but I will say that agencies and businesses do not perceive the death of AEM as near, enterprises are still using it pretty heavily, and SKUs like AEM Guides which is internally facing will likely not go away anytime soon.