That's what the "kthreadd" kernel process is for.
Try this command:
ps axo pid,ppid,comm | less
The kernel-created processes will all have "kthreadd" as their Parent Process ID (PPID). Typically init and kthreadd are the only processes with a PPID of 0.