Looks like this can be done with: https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Actions-UpdateFocus.html
To enable it you need to add the focusOnMouseMove
event handler:
import XMonad.Actions.UpdateFocus xmonad $ def { .. startupHook = adjustEventInput handleEventHook = focusOnMouseMove .. }