I don't think you can actually get that "userId" from the TaskEvent. At least, I couldn't find it in the code.
That "userId" is the user that issues the "delegate" operation. So, either it is the logged in user, or, if you're using KIE-Server and setting "bypassAuth", it's the user passed in the request to KIE-Server.
It doesn't seem that that userId is added to the TaskEvent when that event is created. What's your specific use-case? Maybe we can find another way to achieve the required result. Do you really want to have the "userId" of the user firing that command? Or do you want to log the userId of the task-owner before it got delegated?