For domestic flights, I'd say around 2 hours before. For international, maybe 2.5-3 hours before.
The Newark Airport Express Bus has trips that leave every 15 minutes starting at 5AM:
https://newarkairportexpress4.reachl...ewark/StopInfo
For NJ Transit, I'd say to catch one of those trains leaving a little after 5AM from Penn Station:
http://www.njtransit.com/pdf/rail/R0070.pdf
It's the Northeast Corridor and North Jersey Coast Line that go there. They announce the track about 5 minutes beforehand, so you'll have to be there a little early to look at the board.