By using the SharePoint 2007 (and above) Out-Of-The-Box "User Profile" Web Service found at the following location:
You can easily obtain information about the group membership (both Active Directory and SharePoint Groups) of a particular user - not just their basic user profile information (e.g. Mobile, Manager). This can be done with the GetCommonMemberships() method.
In this way, without code and without directly accessing Active Directory/LDAP, you can find the group memberships of a user for consumption in an InfoPath form by consuming it as a Web Service-based datasource.
For implementation details of a code-free InfoPath consumption of this web service, see: