Recall that a forward contract on $S_T$ contracted at time $t$, with time of delivery $T$, and with forward price $f(t; T, S_T)$ can be seen as a contingent T-claim $X$ with payoff: $$ X = S_T - f(t; T, S_T) $$ The forward price is determined at time t in such a way that the price of X is zero at time t, i.e. $\pi(t;X) = 0$.
How can I compute the forward price $f(t; T, S_T )$ in the Black-Scholes model?
Without loss of generality take $t=0.$ The price of any European claim $g(S_T)$ under black scholes is given by: $$ P = {\mathbb E}^*[e^{-rT} g(S_T)]. $$ For the forward contact $g(S_T) = S_T -K$ and we would like to choose $K$ sothat $P=0$, then: $$ 0= {\mathbb E}^*[e^{-rT}(S_T -K)] $$ ($K$ is the $ f(t;T,S_T)$ in your question). The discounted price process $e^{-rt}S_t$ is a martingale under the risk neutral $P^*$ measure, therefore ${\mathbb E}^*[e^{-rT}S_T] =S_0.$ This and the last equation gives $$ Ke^{-rT} = S_0 $$ and therefore, $K =S_0 e^{rT}.$
In fact, this price is correct for any risk neutral pricing model (not just BS) and will continue to hold as long as the interest rate is constant.