Tannakian duality for $\mathrm{SL}_{2}(\mathbb{R})$

Tannakian duality claims that we can recover any compact group from its finite-dimensional representations. More generally, we can recover affine group scheme from its finite-dimensional representations. In this Milne's note, he said that for any topological group $$K$$, the category $$\mathbf{Rep}_{\mathbb{R}}(K)$$ of continuous finite-dimensional representations of $$K$$ is a neutral Tannakian category, so there exists an affine algebraic group $$\widetilde{K}$$ over $$\mathbb{R}$$ such that its category of representations $$\mathbf{Rep}_{\mathbb{R}}(\widetilde{K})$$ is isomorphic to $$\mathbf{Rep}_{\mathbb{R}}(K)$$. Such $$\widetilde{K}$$ is called real algebraic envelope of $$K$$, and we also have a map $$K\to \widetilde{K}(\mathbb{R})$$ which is an isomorphism if $$K$$ is compact.

I want to know how to find $$\widetilde{K}$$, or at least $$\widetilde{K}(\mathbb{R})$$ if $$K$$ is not compact. For example, let $$K = \mathrm{SL}_{2}(\mathbb{R})$$. I strongly believe that we cannot recover the group $$\mathrm{SL}_{2}(\mathbb{R})$$ from its finite-dimensional representations since it has a lot of interesting infinite dimensional representation (which are related to the theory of automorphic forms). So $$\widetilde{K}$$ won't be just $$\mathrm{SL}_{2}$$ and $$\widetilde{K}(\mathbb{R})$$ may not be isomorphic to $$\mathrm{SL}_{2}(\mathbb{R)}$$. Is this correct?

The finite-dimensional representations of $$\mathrm{SL}_2(\mathbb{R})$$ are the same whether it is regarded as an algebraic group or a Lie group (or a topological group). Thus the group attached to the category of representations is the algebraic group $$\mathrm{SL}_2$$. In a sense, the category the finite-dimensional representations determine the infinite-dimensional representations. For a summary of the relation between the representations of reductive Lie groups and reductive algebraic groups, see Chapter III of the notes "Lie algebras, algebraic groups, and Lie groups" (LAG) on Milne's website.
[The group $$\mathrm{SL}_2(\mathbb{R})$$ determines its representations, but that doesn't mean we don't have to study its representations.]