Given a nice enough probability measure for a random variable $X$ that takes values on a real vector space $V$ we can define the moment generating function $Z:V^*\rightarrow\mathbb R$ by
$$Z(j)=\mathbb E(\exp(j(X))).$$
which has the property that given a basis $\{e_i\}_{i\in I}$ for $V$ we can decompose the vectors $$X=\sum_{i\in I}X_ie_i,\quad j=\sum_{i\in I}j_ie^*_i$$ which nicely encodes the moments of the distribution as a Maclaurin series
$$\left.\frac{\partial^n Z}{\partial j_{a_1}\dots\partial j_{a_n}}\right|_{j=0}=\mathbb E(X_{a_1}\cdots X_{a_n}).$$
My question is then simple to pose. For what other types of spaces can a similar thing be defined? To me it seems, for example, that this can be done on any manifold with an affine structure by choosing an origin (maybe it even translates directly to any parallelizable manifold?)
To narrow it down a little, note also that for any random variable $X$ that takes values in a metric space $M$ and a point $x_0\in M$ one could define $Z:\mathbb R\rightarrow\mathbb R$ by
$$Z(j)=\mathbb E(\exp(j\cdot d(X,x_0))),$$
but this is not what I'm interested in, as it loses the "directionality" aspect of what can be done in a vector space.