You can use the relationship query and query on PermissionSet Object which has all these permissions mentioned. You can query on PermissionSetAssignment and traverse to PermissionSet object and get the required results.
Your SOQL query should be something like below
SELECT AssigneeId,PermissionSetId,PermissionSet.PermissionsManageNetworks, PermissionSet.PermissionsConnectOrgToEnvironmentHub, PermissionSet.PermissionsPackaging2 FROM PermissionSetAssignment WHERE Assignee.Username='[email protected]'
This below query will give you the records from Profile and PermissionSet
SELECT AssigneeId, permissionset.name, PermissionSetId FROM PermissionSetAssignment WHERE Assignee.FederationIdentifier='d866070' and (PermissionSet.PermissionsManageNetworks=true or PermissionSet.PermissionsConnectOrgToEnvironmentHub=true or PermissionSet.PermissionsPackaging2=true)
There is a field called IsOwnedByProfile on PermissionSet which mention that the permission is provided at Profile level or PermissionSet level. Adding a additional check on the above query can get you the records only from Profile or only from PermissionSet. If you want only records of PermissionSet, get the records where IsOwnedByProfile is false, so your query would be
SELECT AssigneeId, permissionset.name, PermissionSetId FROM PermissionSetAssignment WHERE Assignee.FederationIdentifier='d866070' and (PermissionSet.PermissionsManageNetworks=true or PermissionSet.PermissionsConnectOrgToEnvironmentHub=true or PermissionSet.PermissionsPackaging2=true) and PermissionSet.IsOwnedByProfile = false
You can refer the documentation on PermissionSet for further information.