I think that a good way to think about the second setting is in terms of automorphic representations (and Harris is "the" authority, although I don't remember BHR reference specifically). Let $G=GL(2,\mathbb{R}), \Gamma=SL(2,\mathbb{Z})$$G=GL_{+}(2,\mathbb{R}), \Gamma=SL(2,\mathbb{Z})$. A modular form $f$ of weight $k$ can be lifted in a standard way to a function on $G/\Gamma$, real group $G$ acts on functions by translation and $f$ generates a representation of $G.$ This function transforms as the $k$th power of the standard 1-dim representation of $K=O(2,\mathbb{R})$$K=SO(2,\mathbb{R})$ and the holomorphy of $k$$f$ translates into the condition that it's the lowest $K$-type (which is scalar).
In the Shimura case, $G$ is of Hermitian type, so it contains a $U(1)$ factor and hence admits scalar representations labeled by an integer $k$. Holomorphic representations (=lowest weight modules) with scalar minimal (here: lowest) $K$-type form a direct analogue of the classical case, i.e. scalar automorphic forms. More generally, as Brian and Emerton said, you can start with any $K$-module and form the corresponding automorphic vector bundle, coherent sheaf, etc. In the group theoretic language, you'd be considering a lowest weight module with a general LKT $\sigma$ (minimal $K$-type always has multiplicity 1) realized in functions $G\to V_\sigma$ equivariant under $K$.