Let $A \to B$ be a homomorphism of rings, let $S$ (resp. $T$ ) be a multiplicative subset in $A$ (resp. $B$) such that the image of $S$ in $B$ is contained in $T$ , and let $N$ be a $B$-mod.
How to show $T^{-1}(N \otimes_A M) \cong T^{-1}N \otimes_A M$ ?
By the universal property of tensor of module, I have the homomorphism such that $T^{-1}N \otimes_A M \ni (n/t) \otimes m \mapsto (n\otimes m)/t \in T^{-1}(N \otimes_A M)$.
However, in the case of the converse direction, I have no idea to construct a homomorphism except for struggling to prove the well-definedness by taking the elements.
Is there clear way ?
We can construct mutually inverse isomorphisms of $B$-modules as follows:
The map $$ N × M \to (T^{-1} N) ⊗_A M \,, \quad (n, m) \mapsto (n / 1) ⊗ m $$ is $A$-linear in the second argument and $B$-linear in the first, and therefore induces a $B$-linear map $$ N ⊗_A M \to (T^{-1} N) ⊗_A M \,, \quad n ⊗ m \mapsto (n / 1) ⊗ m \,. $$ Every element of $T$ acts invertibly $T^{-1} N$ and therefore also invertibly on $(T^{-1} N) ⊗_A M$. We get therefore an induced homomorphism of $T^{-1} B$-modules $$ φ \colon T^{-1}(N ⊗_A M) \to (T^{-1} N) ⊗_A M \,, \quad (n ⊗ m)/t \mapsto (n / t) ⊗ m \,. $$
Let us now construct the inverse of $φ$, which we shall call $ψ$. For every element $m$ of $M$, we have the map $$ N \to N ⊗_A M \to T^{-1} (N ⊗_A M) \,, \quad n \mapsto n ⊗ m \mapsto (n ⊗ m) / 1 \,. $$ This map is $B$-linear, and every element of $T$ acts invertibly on $T^{-1}(N ⊗_A M)$. We get therefore an induced homomorphism of $T^{-1} B$-modules $$ ψ_m \colon T^{-1} N \to T^{-1} (N ⊗_A M) \,, \quad n / t \mapsto (n ⊗ m) / t \,. $$ By combining these maps $ψ_m$, we get a map $$ (T^{-1} N) × M \to T^{-1} (N ⊗_A M) \,, \quad ((n / t) , m) \mapsto (n ⊗ m) / t \,. $$ This map is $T^{-1} B$-linear in the first coordinate (since these are the maps $ψ_m$), and $A$-linear in the second coordinate. We get therefore an induced homomorphism of $T^{-1} B$-modules $$ ψ \colon (T^{-1} N) ⊗_A M \to T^{-1} (N ⊗_A M) \,, \quad (n / t) ⊗ m \mapsto (n ⊗ m) / t \,. $$
The two homomorphisms $φ$ and $ψ$ are mutually inverse. The homomorphism $φ$ is therefore an isomorphism, with inverse given by $ψ$.
We could also show the isomorphism $T^{-1} (N ⊗_A M) ≅ (T^{-1} N) ⊗_A M$ by using
that localizing at $T$ is isomorphic to extension of scalars from $B$ to $T^{-1} B$, which is turn is isomorphic to $T^{-1} B ⊗_B (-)$; and
the associativity of the tensor product.
We get from these ingredients the chain of isomorphisms of $T^{-1} B$-modules. $$ T^{-1} (N ⊗_A M) ≅ (T^{-1} B) ⊗_B (N ⊗_A M) ≅ ((T^{-1} B) ⊗_B N) ⊗_A M ≅ (T^{-1} N) ⊗_A M \,. $$ These isomorphisms can explicitly be described as $$ (n ⊗ m)/t \enspace\mapsto\enspace (1 / t) ⊗ (n ⊗ m) \enspace\mapsto\enspace ((1 / t) ⊗ n) ⊗ m \enspace\mapsto\enspace (n / t) ⊗ m \,. $$ The overall isomorphism from $T^{-1} (M ⊗_A N)$ to $(T^{-1} N) ⊗_A M$ is therefore the same as in the previous approach (namely $φ$).