Obtaining atomic form factor from electron density?
Here is a possible source: Modern X-ray analysis on single crystals: a practical guide by Peter Luger, De Gruyter, Inc. 2014.

The relevant excerpt describing how to estimate the density of an atom j, and with that, the scattering factor (really scattering function) is below.



So atomic scattering factors are derived by taking the Fourier transform of the computed electron density of a stationary atom (the density has spherical symmetry, so the scattering factor is a function that only depends on $s = \sin \theta / \lambda$).