I don't think the problem is that piping doesn't work. I think your problem is that you probably receive a deserialized version of the user object. The Get-ADPrincipalGroupMembership may depend on the object in the pipeline having a specific object type, or it may be trying to find the "Identity" property in the object that it receives from the pipeline.
Start by having a look at the properties in the user object returned by Get-ADUser. Have a look at the "Inputs" section of the cmdlet's help. Is the object type you got from the Get-ADUser an "ADPrincipal" or one of the derived types? If not, is there an "Identity" property in the object?