Actually, the oneagent library is added to the process. This library handles the instrumentation for every process. Depending on the process type, it links also other library (for example liboneagentnginx ).
Generally, each library intercepts necessary calls inside the instrumented process. For NGINX it intercepts calls to NGINX functions. For NET it also inserts oneagent NET assemblies. ( you can find them in the oneagent directory).