When a port forward is implemented by a proxy process (such as on application layer firewalls, SOCKS based firewalls, or via TCP circuit proxies), then no packets are actually translated, only data is proxied. When used on machines that are not the default gateway of the network, the source address must be changed to be the address of the translating machine, or packets will bypass the translator and the connection will fail. The source address and port are, in this case, left unchanged.
When used on gateway devices, a port forward may be implemented with a single rule to translate the destination address and port. BSD and macOS operating systems prior to Yosemite (OS 10.10.X) implement it in the Ipfirewall (ipfw) module while macOS operating systems beginning with Yosemite implement it in the Packet Filter (pf) module. In Linux kernels, this is achieved by packet filter rules in the iptables or netfilter kernel components.