In general, it's considered polite and respectful to wait for a personal invitation before attending someone else's family member's wedding. Even if the family member knows you and is aware of your presence, it's still best to receive a formal invitation. Weddings are personal and intimate events, and the guest list is usually carefully curated by the couple and their families.
If you're close to the family and have a good relationship with them, you can express your interest in attending the wedding to the family member who is getting married. They can then communicate your desire to attend to the couple, and they can extend an invitation if they feel it's appropriate.
Attending a wedding without a formal invitation may put the couple and their families in an uncomfortable position, and it might not be well-received by others in attendance. Respect their wishes and decisions regarding their guest list, and if you're not invited, it's best to offer your congratulations and well-wishes without expecting an invitation.