Great question — answering as the UphillTech team:
In system headers; in the FreeBSD source tree it's sys/sys/proc.h, search for "struct thread" and "struct proc". You might also want to consult the "Design and Implementation of the FreeBSD Operating System" book.
Full answer by Edward Tomasz Napierala: https://unix.stackexchange.com/a/181398 (CC BY-SA 3.0).
Need it done for your business? UphillTech.