Automation to blocklist

Is it possible to build an automation that would blocklist in both directions, meaning if somebody unsubscribed from a marketing campaign, that would automatically unsubscribe them from transactional emails? Or vice versa. Thank you.