[AutoDiff] Lookup for custom derivatives in non-primary source files (#58965)
* Lookup for custom derivatives in non-primary source files after typecheck is finished for the primary source.
This registers all custom derivatives before autodiff transformations and makes them available to them.
Fully resolves #55170