From https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3667970/:

Given a measure $\sigma$ with associated density $\gamma$, how can I make sense of the fact that the tangent space is the set of all $L_2$-integrable functions w.r.t $\sigma$? I do not see where this can be harmonized with the "standard" definition of a tangent space.
First note the word "formally" here - the space of measures is technically not a Riemannian manifold, be it only for the reason that it is infinite-dimensional (but it also doesn't fit well with various notions of infinite-dimensional manifolds).
Even formally, I think this description is not quite right. The tangent space should only contain gradient vector fields. With this restriction, the connection to the usual definition of tangent space is as follows: To every gradient vector field $v\in L^2(\Omega,\sigma)^d$ one can associate a curve $\gamma$ such that $\sigma$ by $\dot\gamma_0+\nabla\cdot(\sigma v)=0$. Conversely, if $(\gamma_t)$ is a curve through $\sigma$, the associated gradient vector field $v$ is the unique solution of $\dot\gamma+\nabla\cdot(\sigma v)=0$ (here one needs the vector field to be a gradient vector field to get uniqueness).
Note that this discussion is not rigorous and one has to verify that the two equations above to have (unique) solutions in the right space, which requires additional technical assumptions on the input data. This is another reason why people usually state that this correspondence is formal. Some things can be made rigorous in the setting of infinite-dimensional differential geometry, but I don't think there is any detailed write-up - the community clearly prefers the metric geometry approach. Probably the closest you will find is the article Some Geometric Calculations on Wasserstein Space by John Lott.