If you have access to a linux box you can use the command iptables-translate to do this. Just replace the command "iptables" with "iptables-translate".
However, nftables doesn't have a fixed set of chains like PREROUTING etc it can have multiple tables and multiple chains per table with whatever organization you want. You'd have to know a bit more about OpenWrt's fw4 to figure out where to put these commands.
# /etc/config/firewall
config include
option type 'nftables'
option path '/etc/mangle_prerouting.nft'
option position 'chain-pre'
option chain 'mangle_prerouting'
config include
option type 'nftables'
option path '/etc/mangle_postrouting.nft'
option position 'chain-pre'
option chain 'mangle_postrouting'
config include
option type 'nftables'
option path '/etc/mangle_forward.nft'
option position 'chain-pre'
option chain 'mangle_forward'
# /etc/mangle_prerouting.nft
ip protocol udp ip daddr 192.168.1.127 counter ip dscp set 0x2e
# /etc/mangle_postrouting.nft
ip protocol udp ip saddr 192.168.1.127 counter ip dscp set 0x2e
# /etc/mangle_forward.nft
ip protocol udp udp sport 3074 counter ip dscp set 0x2e
ip protocol udp udp dport 3074 counter ip dscp set 0x2e