For simplicity, assume that $S$ is affine (every algebraic space has a dense open subset that is an affine scheme). In the case of a proper morphism of Noetherian algebraic spaces,$$ f:X\to S,$$ for $\mathcal{F}$ an $f$-flat coherent sheaf, there exist (locally on $S$) a bounded complex $K^\bullet$ of locally free $\mathcal{O}_S$-modules and an equivalence of contravariant functors, $$H^p(X\times_S T,\text{pr}_X^*\mathcal{F}) \cong h^p(K^\bullet\otimes_{\mathcal{O}_S(S)}\mathcal{O}_T(T)),$$ on the category of algebraic spaces $T$ with an affine morphism $T\to S$. The proof is essentially the same as the proof of the Theorem on p. 46 of the following.
MR2514037 (2010e:14040)
Mumford, David
Abelian varieties.
With appendices by C. P. Ramanujam and Yuri Manin.
Corrected reprint of the second (1974) edition.
Tata Institute of Fundamental Research Studies in Mathematics, 5.
Published for the Tata Institute of Fundamental Research, Bombay; by Hindustan Book Agency, New Delhi, 2008. xii+263 pp.
The bounded complex $K^\bullet$ has finitely many nonzero cohomology sheaves, and these are each coherent. If $S$ is reduced, these coherent sheaves are each locally free on a dense Zariski open by Grothendieck's Generic Flatness Theorem. Thus, on a dense Zariski open, the complex $K^\bullet$ has locally free cohomology sheaves. Thus, all of the cohomologies split, and the complex is quasi-isomorphic to the direct sum of its locally free cohomology sheaves. Replacing $S$ by this dense Zariski open, every $H^p(X\times_S T,\text{pr}_X^* \mathcal{F})$ is naturally equivalent to the locally free $\mathcal{O}_T$-module $h^p(K^\bullet)\otimes_{\mathcal{O}_S(S)}\mathcal{O}_T(T).$ This is compatible with arbitrary base change.