If you're being keylogged or if you downloaded a RAT, the command "netstat -an" in CMD will show you a list of IPs and ports that are connected to your computer. Your hacker's IP if he isn't using a VPN will be in this list of IPS and opened ports on your command prompt. You could still find his VPN IP though if he has a VPN on. Google more about it, don't really feel like explaining everything here. I recommend you discuss these kinds of things on a hacking-related forums though.