IIRC MediaWiki has a mixin visually-hidden that gets some usage across MediaWiki code (such as T209253), but there’s no common way to visually hide the text for screen reader users.
I think we should come up with one common class for this, since, unlike the MediaWiki developers, end-users in Wikimedia projects can’t use a relevant mixin and shouldn’t have to duplicate the code for an extremely common occurrence for accessibility work. This is especially true when considering that end-users can’t even rely on MediaWiki:Common.css for this, since any wiki-level CSS won’t load instantly for users on mobile.