I have tried to find that out before my ships have left and never got a good answer. I can tell you the rule of thumb is the second night is usally the formal, casuals are nights you are docked somewhere, and the last formal (if there is one) is the last night of the cruise or the night you leave your last port.
I know that does not help too much but it gives you an idea.
Formal nights are usually on sea days, the second and the next to last night. On the last night you have to get your packed luggage out to the hall so it can be picked up during the night. So, in general, that would not be formal night.
and it will be posted daily in your ships newsletter. Formal nights are usually the night of your first full day at sea. and the night of your last full day at sea. (Second to last night)
First and last nights are always casual. Port days are usually casual. Ask your TA exactly how many of each you will have or look at your information booklet it will be in there usually under the FAQ section.