Is there a way to do per-application rules in pfctl/alf?
Have you looked at this post (see comment dated 30 Aug from user mhils)?  Basically, running in mitmproxy in transparent mode can be accomplished with the -T argument.  It appears that this is supposed to provide access to the PID of the source process, but I am not sure that the destination process id is captured.

I am not a user of mitmproxy, so please let me know if this helps.

Cheers,
Byron