It is not that logical to represent primes using Fourier transform directly. Fourier transform has linearity in mind and there is some linearity but not the one that can be easily exploited among primes.

At first, it looks like sieving, when you cross every second then every third then every fifth number and so on, is linear in nature, right? But this is just hiding a painful truth that $2 \cdot 3 = 6$ and that $2+3$ is not revealing anything regarding the composition of $5$.

If you start that every number can be represented uniquely as a product of primes

$$n=\prod_{k=1}^{\omega(n)}p_{m_k}^{\alpha_k}$$

you obtain intended linearity using

$$\ln(n)=\sum_{k=1}^{\omega(n)}\alpha_k\ln(p_{m_k})$$

Technically if you allow $\alpha_k=0$ you have

$$\ln(n)=\sum_{k=1}^{+\infty}\alpha_k\ln(p_k)$$

where $\alpha_k=0$ means that $p_k$ is not a factor of $n$, that $n$ is not divisible by $p_k$.

This, observing prime numbers using logarithmic scale, is bringing you to a cousin of Fourier transform, which is the Mellin transform. To illustrate it, we will use Gamma function, the extension of factorial, so if $f(x)=e^{-x}$ then its Mellin transform is the Gamma function

$$\Gamma(s) = \int_0^\infty e^{-x}x^{s-1} dx$$

We *can* define Fourier transform using Mellin transform, true, but you inevitably grab for logarithmic scaling in the process.

To understand why Mellin tastes better, we define Riemann zeta function as Mellin transform of another function $f(x)=\frac1{e^x-1}$ i.e.:

$$\zeta(s) = \frac1{\Gamma(s)}\int_0^\infty \frac1{e^x-1}x^{s-1} dx$$

To understand how intimate this function is to the primes, a few relations:

$$\ln\zeta(s) = s\int_0^\infty \frac{\pi(x)}{x(x^s-1)} dx$$

$$\frac{1}{\zeta(s)}=\sum_{n=1}^\infty \frac{\mu(n)}{n^s}$$

$$\zeta^2(s) =\sum_{n=1}^\infty \frac{d(n)}{n^s}$$

$$-\frac{\zeta'(s)}{\zeta(s)} = \sum_{n=1}^\infty \frac{\Lambda(n)}{n^s}$$

$$\frac{\zeta^2(s)}{\zeta(2s)} = \sum_{n=1}^\infty \frac{2^{\omega(n)}}{n^s}$$

where

$\pi(x)$ is number of primes up to $x$

$\mu(n)$ is Möbius function equal to $0$ if $n$ is divisible by square otherwise $1$ if it has even and $-1$ if it has odd number of prime factors

$d(n)$ is number of divisors of $n$

$\Lambda(n)$ is the von Mangoldt function equal to $\ln(p)$ if the number $n$ is $n=p^k$ otherwise $0$

$\omega(n)$ is the number of distinct prime factors of $n$

and many more relations like these.

Again, we are not far away from Fourier transform, we are just basically scaling it in order to extract multiplicative essence. Pure Fourier transform might connect two multiplicative relations related to primes, but to dig very deep into the primes we need related Mellin transform.

Regarding prime factorization, there is not much there where Fourier transform is directly involved. The problem is so complex that techniques are bordering with mathematical limits not rarely using guessing and heuristics even when the factorization is expect to run very fast and when the algorithm is quite precise and sound.

Still if you look back at the Riemann zeta function defined above as

$$\zeta(s)=\sum_{n=1}^{\infty} n^{-s} = \prod_{p \text{ is prime}}\frac1{1-p^{-s}}$$

you have readily available factorization of each $n$, albeit you cannot extract it directly. Because Riemann zeta function is intimately related to other arithmetic functions, all you need is to be able to extract $n^{th}$ coefficient of any interesting sum:

$$f(s)=\sum_{n=1}^{\infty}\frac{a_n}{n^s}$$

and that would be

$$\frac{a_n}{n^{\sigma}} = \lim_{T\to\infty} \frac{1}{2T} \int_{-T}^{T} f(\sigma+ it)n^{it} \mathrm{d}t$$

and you can obtain sufficient information about factorization to start the actual factorization. This is not the fastest possible known way, but it is the way that is relating Fourier, i.e. Mellin transform, with the factorization process more directly than with other known methods.