A general way of expressing a four-current due to a single charge is:
$J^\mu\left(x\right) =qc\int d\tau \, u^\mu \delta^{\left(4\right)}\left(x-\bar{x}\left(\tau\right)\right)$
Where $q$ is the charge, $c$ is the speed of light, $\delta^{\left(4\right)}\left(x-\bar{x}\left(\tau\right)\right)=\delta\left(c\left(t-\bar{t}\left(\tau\right)\right)\right)\delta^{\left(3\right)}\left(\mathbf{r}-\bar{\mathbf{r}}\left(\tau\right)\right)$ is the 4d delta function, $\tau$ is the proper time of the particle and $\bar{x}^\mu=\bar{x}^\mu\left(\tau\right)$ is the world line of the particle. This should be your starting point, IMHO.
Also, accrding to my calculations:
$\frac{1}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) J^\mu\left(t,\mathbf{r}\right)=q$
where $\gamma$ is the Lorentz factor of the charge. So maybe this is what you were looking for.
Still, your question was about how to deal with $f=f\left(\mathbf{r}-\bar{\mathbf{r}}\left(t\right)\right)$ (I hope you don't mind me changing notation slightly). Now you want to consider some boosted frame with coordinates $\{ct',\,\mathbf{r}'\}$. Clearly you will have a procedure for changin the coordinates from $S'$ to $S$: $t=t\left(t',\,\mathbf{r}'\right)$ and $\mathbf{r}=\mathbf{r}\left(t',\mathbf{r}'\right)$. Essentially, the inverse of what you wrote. Then your function in $S'$ is simply:
$f\,in\,S'=f\left(\mathbf{r}\left(t',\mathbf{r}'\right)-\bar{\mathbf{r}}\left(t\left(t',\mathbf{r}'\right)\right)\right)$
However you have to be careful. Just because the function is not a vector it does not mean it is a true scalar. For example $\delta^{\left(3\right)}$, i.e. the 3d delta-function, is actually a density, hence when you change coordinate frame you will get Jacobians coming out (hello length contraction). Also, you have to be careful with integrals $\int d^3 r\dots$ is an integral over 3d space that is perpendicular to temporal axis in the current refrence frame. In a different reference frame this 3d space will no longer be perpendicular to temporal axis, it could be partially spatial and partially temporal.
Following from the comments
$\frac{1}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) J^\mu\left(t,\mathbf{r}\right)=\frac{q}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) \: \int cd\tau \: u^\mu\left(\bar{t}\left(\tau\right)\right) \delta^{\left(4\right)}\left(x-\bar{x}\left(\tau\right)\right))$
Expand the 4D delta function for the current observer. The world-line of the particle in the current frame is $\bar{t}=\bar{t}\left(\tau\right)$ and $\bar{\mathbf{r}}=\bar{\mathbf{r}}\left(\tau\right)$:
$\frac{1}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) J^\mu\left(t,\mathbf{r}\right)=\frac{q}{c^2}\gamma\left(t\right) u_\mu\left(t\right) \int cd\tau \: \delta\left(c\left(t-\bar{t}\left(\tau\right)\right)\right) u^\mu\left(\bar{t}\left(\tau\right)\right) \int d^3 r\, \delta^{\left(3\right)} \left(\mathbf{r}-\bar{\mathbf{r}}\left(\tau\right)\right) $
The last integral over the 3d delta function trivially vanishes so
$\frac{1}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) J^\mu\left(t,\mathbf{r}\right)=\frac{q}{c^2}\gamma\left(t\right) u_\mu\left(t\right) \int cd\tau \: \delta\left(c\left(t-\bar{t}\left(\tau\right)\right)\right) u^\mu\left(\bar{t}\left(\tau\right)\right)$
Next we change the integration variable: $\frac{d\bar{t}}{d\tau}=\gamma\left(\bar{t}\right)$. Clearly there is slight abuse of notation here, but since there is a bijective relationship between $\bar{t}$ and $\tau$, it is ok. So:
$\frac{1}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) J^\mu\left(t,\mathbf{r}\right)=\frac{q}{c^2}\gamma\left(t\right) u_\mu\left(t\right) \int \frac{cd\bar{t}}{\gamma\left(\bar{t}\right)} \: \delta\left(c\left(t-\bar{t}\right)\right) u^\mu\left(\bar{t}\right)=\frac{q}{c^2}\gamma\left(t\right) u_\mu\left(t\right) \frac{1}{\gamma\left(t\right)} u^\mu\left(t\right)=\frac{q}{c^2}u_\mu\left(t\right) u^\mu\left(t\right)=q$
Since $u_\mu u^\mu = c^2$ at all times
I think a comprehensive answer can be reached using the language of differential forms.
One of the Maxwell's laws in differential forms is:
$d\star F=\mu_0 J$, where $J$ is the current density 3-form (of a charged particle in some motion) and $F=dA$ is the electromagnetic 2-form ($A$ is the vector potential 1-form).
Consider the integral of the left-hand-side over $\Omega$, the 3d sub-space of the space-time that is perpendicular the the four-velocity of the particle at some time in its history. At that time, therefore $\Omega$ is aligned with the rest-frame of the particle ($\tilde{S}$).
Then, using Stokes theorem:
$\int_\Omega d\star F = \oint_{\partial\Omega} \star F$
Now $\star F = -\frac{\tilde{\epsilon}_{ijk}}{2c} \tilde{E}^k d\tilde{x}^i\wedge d\tilde{x}^j + c g_{kk'}\tilde{B}^{k'}d\tilde{t}\wedge d\tilde{x}^k$
where $\tilde{E}$ and $\tilde{B}$ are the electric and magnetic fields in the rest-frame (for point-charge $\tilde{B}=0$) and latin indices run over spatial parts only. It follows that:
$ -\frac{1}{c} \int_{\Omega} J= \frac{1}{\mu_0 c^2} \oint_{\partial\Omega} \tilde{\epsilon}_{ijk}\tilde{E}^k d\tilde{x}^i\wedge d\tilde{x}^j= \epsilon_0 \oint_{\partial\Omega} \mathbf{\hat{n}}.\tilde{\mathbf{E}}\,d^2x = q$
Where I have used the integral form of the Gauss' law, and $\mathbf{\hat{n}}$ is the outward pointing normal vector.
Now, come back to the current 3-form. Explicitly this is given by:
$J=\epsilon_{\alpha\beta\sigma\mu} J^\mu dx^\alpha \wedge dx^\beta \wedge dx^\sigma$
Where $J^\mu$ is the usual current density. The integral over $\Omega$ may be now cosidered in terms of the current density:
$\int_\Omega J = \int_{\mathbb{R}^3} d^3 \breve{x} \, \frac{\partial x^\alpha}{\partial \breve{x}} \frac{\partial x^\beta}{\partial \breve{y}} \frac{\partial x^\sigma}{\partial \breve{z}} J_{\alpha\beta\sigma}\left(x\left(\breve{x}\right)\right) = -\frac{1}{c}\int_{\mathbb{R}^3} d^3 \breve{x} \, u_\mu J^\mu$
Where in the second step I used a pull-back to Eucledian 3d space (addressed by coordinated $\breve{x}, \breve{y}, \breve{z}$) in order to evaluate the differential form integral. The push-forward is
$
\begin{align}
ct &= \gamma \frac{v}{c}\breve{x} + \gamma c\breve{t}_0 \\
x &= \gamma \breve{x} + \gamma v \breve{t}_0\\
y &= \breve{y}\\
z &= \breve{z}
\end{align}
$
Where $\breve{t_0}$ is constant. Basically $\breve{S} \cong \mathbb{R}^3$ is like the rest-frame of the charge at proper time $\tau = \breve{t}_0$
So (with some more work):
$q = \frac{1}{c^2} \int_{\mathbb{R}^3} d^3 \breve{x} \, u_\mu J^\mu$
It would seem therefore that the important part is the time at which you evaluate your integral. If you are evaluating at fixed lab time, which is like the algebraic derivation, I gave originally, then you need the Lorentz factor. If, on the other hand, you are evaluating at fixed proper time, like the differential forms approach above, then the Lorentz factor is not needed.