First, check ifconfig for ethernet connection name, something like eth0 or enp4s0

Write down /etc/NetworkManager/dispatcher.d/99-wlan, adapting name

#!/bin/bash

if [ \"$1\" = \"enp4s0\" ]; then
  case \"$2\" in
    up)
      nmcli radio wifi off
      ;;
    down)
      nmcli radio wifi on
      ;;
  esac
fi

Then

chmod +x /etc/NetworkManager/dispatcher.d/99-wlan