Not sure if I follow you, but as I understand your question you observed $k$ successes in $n$ trials and used this data in a beta-binomial model. If your prior was $\mathsf{Beta}(\alpha, \beta)$, then the posterior is $\mathsf{Beta}(\alpha + k, \beta + n-k)$. Now, let's go one step back, your model is
$$\begin{align}
\mu &\sim \mathsf{Beta}(\alpha, \beta) \\
X_n &\sim \mathsf{Bin}(\mu, n)
\end{align}$$
where $X_n = \sum_{i=1}^n Y_i$ for $Y_i \underset{i.i.d.}{\sim} \mathsf{Bern}(\mu)$. In plain English, you assume that $\mu$ is the probability of "success" for $n$ independent Bernoulli trials. The sum of the ones and zeros from the Bernoulli trials $X_n$ makes a binomial distribution. If now you want to make a guess on the number of successes in $m \ne n$ independent Bernoulli trials, you can just plug in $\mu$ into the binomial distribution $\mathsf{Bin}(\mu, m)$. The trials are identical and independent, so it is like tossing a coin $m$ times instead of $n$, each individual toss behaves the same regardless of how many times you toss.
You can also look at it through the lens of linearity of expectation. The expected value of a single Bernoulli trial is $E[Y_i] = \mu$, for $n$ trials it is $E[nY_i] = n E[Y_i] = n\mu$ and for $m$ trials $m\mu$. Those correspond to the means of the binomial distributions.
So yes, you just plug in the estimated $\mu$.
I found a similart formula (and I understand the logic behind it) to the last one you posted. It is for Bernnoulli case $$ p(x=1|D) = \int_{0}^{1} p(x=1|\mu) p(\mu|D) d\mu = \int_{0}^{1} \mu p( \mu | D) $$.
– Anton Kerel Aug 04 '23 at 09:51$$ p(x=3|D, 40) = \int_{0}^{1} p(x=3|\mu, 40) p(\mu|D, 101) d\mu $$.
This does not feel right since I have the posterior that has a parameter $N$=101 (2success + 99 failures) and the probability that I am trying to estimate is for $N$=40.
– Anton Kerel Aug 04 '23 at 10:00The number of trials in the new experiment ($N=40$) is just a fixed parameter. You know that the conditional distribution for the outcome you care about is $X|\mu \sim \mathrm{Bin}(40, \mu)$, but you want the marginal distribution.
To get this, you need to integrate out $\mu$, i.e. average over all possible values of $\mu$ according to your posterior distribution.
– Doctor Milt Aug 04 '23 at 11:10