By using homotopy transfer techniques in the context of rational homotopy theory, we show that if $C$ is a coalgebra model of a space $X$, then the $A_\infty$-coalgebra structure in $H_*(X;\mathbb{Q})\cong H_*(C)$ induced by the higher Massey coproducts provides the construction of the Quillen minimal model of $X$. We also describe an explicit $L_\infty$-structure on the complex of linear maps ${\rm Hom}(H_*(X; \mathbb{Q}), \pi_*(\Omega Y)\otimes\mathbb{Q})$, where $X$ is a finite nilpotent CW-complex and $Y$ is a nilpotent CW-complex of finite type, modeling the rational homotopy type of the mapping space ${\rm map}(X, Y)$. As an application we give conditions on the source and target in order to detect rational $H$-space structures on the components.