It depends on what type of consent is configured (channel, identity or subscription list) https://experienceleague.adobe.com/en/docs/journey-optimizer/using/email/email-opt-out#opt-out-exter...
Consent data is stored in the XDM under consents.marketing object
For consent at channel level,If consents.marketing.email.val is set to n (via channel level unsubscription), the profile will stop receiving marketing emails. This is to prevent profile from receiving marketing communications through a particular channel.
AJO manages identity-level consent through the consents.idSpecific map where in it is managed per email address.
Ex:- consents.idSpecific.{Namespace}.{Identity}.marketing.{Channel}.val
Profile snapshot dataset will hold this information