It can be easily done using hooks. Max participant is stored in civicrm_event table, so you need to fetch the value and then compare it with the count of participants registered in this event. All this check should be done after a participant is created. So, you could use post hook for the same. Sample(not tested) code is shown below -
function example_civicrm_post($op, $objectName, $objectId, &$objectRef) {
if ($op == 'create' && $objectName == 'Participant') {
//check the count of participant in the event
$participantCount = civicrm_api3('Participant', 'getcount', [
'event_id' => $objectRef->event_id,
]);
//Compare it with the max participant value
$max = civicrm_api3('Event', 'getvalue', [
'return' => "max_participants",
'id' => 1,
]);
//If max equals the count, send an email
if ($max == $participantCount) {
//send email to xyz@example.com
}
}
}