You'd have to add a debug output to the package in question (outputs '("out" "debug")) and possibly pass --enable-debug to configure. Unfortunately, for space reasons, that's not the default in Guix.