It seems you don't really need the "frequency" for the sorting, only the "maximum frequency" per customer. You can use the COUNT(*) OVER (PARTITION BY customerID)
:
SELECT
customerID, eventID,
ROW_NUMBER() OVER (PARTITION BY customerID ORDER BY eventID) AS frequency,
FROM
customerEvent
ORDER BY
COUNT(*) OVER (PARTITION BY customerID) DESC,
customerID,
frequency DESC ;