Under the assumptions of (2) we have $H^0(T, Lg^*K) = H^0(T, H^0(Lg^*K))$. Let us prove that the rule $T \mapsto H^0(T, H^0(Lg^*K))$ satisfies the sheaf property for the fppf topology. To do this assume we have an fppf covering $\{h_i : T_i \to T\}$ of a scheme $g : T \to B$ over $B$. Set $g_i = g \circ h_i$. Note that since $h_i$ is flat, we have $Lh_i^* = h_i^*$ and $h_i^*$ commutes with taking cohomology. Hence $$ H^0(T_i, H^0(Lg_i^*K)) = H^0(T_i, H^0(h_i^*Lg^*K)) = H^0(T, h_i^*H^0(Lg^*K)) $$ Similarly for the pullback to $T_i \times_T T_j$. Since $Lg^*K$ is a pseudo-coherent complex on $T$ (Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-pseudo-coherent-pullback}) the cohomology sheaf $\mathcal{F} = H^0(Lg^*K)$ is quasi-coherent (Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-pseudo-coherent}). Hence by Descent on Spaces, Proposition \ref{spaces-descent-proposition-fpqc-descent-quasi-coherent} we see that $$ H^0(T, \mathcal{F}) = \Ker( \prod H^0(T_i, h_i^*\mathcal{F}) \to \prod H^0(T_i \times_T T_j, (T_i \times_T T_j \to T)^*\mathcal{F})) $$ In this way we see that the rules in (1) and (2) satisfy the sheaf property for fppf coverings. This means we may apply Bootstrap, Lemma \ref{bootstrap-lemma-locally-algebraic-space-finite-type} to see it suffices to prove the representability \'etale locally on $B$. Moreover, we may check whether the end result is affine and of finite presentation \'etale locally on $B$, see Morphisms of Spaces, Lemmas \ref{spaces-morphisms-lemma-affine-local} and \ref{spaces-morphisms-lemma-finite-presentation-local}. Hence we may assume that $B$ is an affine scheme. \medskip\noindent Assume $B = \Spec(A)$ is an affine scheme. By the results of Derived Categories of Spaces, Lemmas \ref{spaces-perfect-lemma-pseudo-coherent}, \ref{spaces-perfect-lemma-derived-quasi-coherent-small-etale-site}, and \ref{spaces-perfect-lemma-descend-pseudo-coherent} we deduce that in the rest of the proof we may think of $K$ as a perfect object of the derived category of complexes of modules on $B$ in the Zariski topology. By  Derived Categories of Schemes, Lemmas \ref{perfect-lemma-pseudo-coherent}, \ref{perfect-lemma-affine-compare-bounded}, and \ref{perfect-lemma-pseudo-coherent-affine} we can find a pseudo-coherent complex $M^\bullet$ of $A$-modules such that $K$ is the corresponding object of $D(\mathcal{O}_B)$. Our assumption on pullbacks implies that $M^\bullet \otimes^\mathbf{L}_A \kappa(\mathfrak p)$ has vanishing $H^{-1}$ for all primes $\mathfrak p \subset A$. By More on Algebra, Lemma \ref{more-algebra-lemma-cut-complex-in-two} we can write $$ M^\bullet = \tau_{\geq 0}M^\bullet \oplus \tau_{\leq - 1}M^\bullet $$ with $\tau_{\geq 0}M^\bullet$ perfect with Tor amplitude in $[0, b]$ for some $b \geq 0$ (here we also have used More on Algebra, Lemmas \ref{more-algebra-lemma-glue-perfect} and \ref{more-algebra-lemma-glue-tor-amplitude}). Note that in case (2) we also see that $\tau_{\leq - 1}M^\bullet = 0$ in $D(A)$ whence $M^\bullet$ and $K$ are perfect with tor amplitude in $[0, b]$. For any $B$-scheme $g : T \to B$ we have $$ H^0(T, H^0(Lg^*K)) = H^0(T, H^0(Lg^*\tau_{\geq 0}K)) $$ (by the dual of Derived Categories, Lemma \ref{derived-lemma-negative-vanishing}) hence we may replace $K$ by $\tau_{\geq 0}K$ and correspondingly $M^\bullet$ by $\tau_{\geq 0}M^\bullet$. In other words, we may assume $M^\bullet$ has tor amplitude in $[0, b]$. \medskip\noindent Assume $M^\bullet$ has tor amplitude in $[0, b]$. We may assume $M^\bullet$ is a bounded above complex of finite free $A$-modules (by our definition of pseudo-coherent complexes, see More on Algebra, Definition \ref{more-algebra-definition-pseudo-coherent} and the discussion following the definition). By More on Algebra, Lemma \ref{more-algebra-lemma-last-one-flat} we see that $M = \Coker(M^{- 1} \to M^0)$ is flat. By Algebra, Lemma \ref{algebra-lemma-finite-projective} we see that $M$ is finite locally free. Hence $M^\bullet$ is quasi-isomorphic to $$ M \to M^1 \to M^2 \to \ldots \to M^d \to 0 \ldots $$ Note that this is a K-flat complex (Cohomology, Lemma \ref{cohomology-lemma-bounded-flat-K-flat}), hence derived pullback of $K$ via a morphism $T \to B$ is computed by the complex $$ g^*\widetilde{M} \to g^*\widetilde{M^1} \to \ldots $$ Thus it suffices to show that the functor $$ (g : T \to B) \longmapsto \Ker( \Gamma(T,g^*\widetilde{M}) \to \Gamma(T, g^*(\widetilde{M^1}) ) $$ is representable by an affine scheme of finite presentation over $B$. \medskip\noindent We may still replace $B$ by the members of an affine open covering in order to prove this last statement. Hence we may assume that $M$ is finite free (recall that $M^1$ is finite free to begin with). Write $M = A^{\oplus n}$ and $M^1 = A^{\oplus m}$. Let the map $M \to M^1$ be given by the $m \times n$ matrix $(a_{ij})$ with coefficients in $A$. Then $\widetilde{M} = \mathcal{O}_B^{\oplus n}$ and $\widetilde{M^1} = \mathcal{O}_B^{\oplus m}$. Thus the functor above is equal to the functor $$ (g : T \to B) \longmapsto \{(f_1, \ldots, f_n) \in \Gamma(T, \mathcal{O}_T) \mid \sum g^\sharp(a_{ij})f_i = 0,\ j = 1, \ldots, m\} $$ Clearly this is representable by the affine scheme $$ \Spec\left(A[x_1, \ldots, x_n]/(\sum a_{ij}x_i; j = 1, \ldots, m)\right) $$ and the lemma has been proved.