Your geometry is a specialised one, as we need to also include heat generation in the stator/rotor coils/windings. Not everyone in the Heat Exchangers field will know these details. If you could provide a cross-sectional sketch, the heat dissipation rate in the machine and its dimensions, it would be helpful to answer your question.
For ages, generators and motors have been designed and manufactured. The totally enclosed, fan-cooled designs are practically standard. I would suggest a net search which will give you the solution or at least help you to pose the question more completely.
@Boulahia, Though the link provided by you has nothing in it to help in the design of CACA Heat exchangers, it was a useful read on electrical machines that we mechanical engineers know so little about. Thank you very much.
Designing a CaCa cooler is not done step by step but is a complete calculation. The maximum dimensions of fans for the external air is very often the start of the calculation. Is sound silencing nessecary? This gives extra pressure loss resulting in less air for the cooler. We design and build these CaCa coolers a lot in all kind of different designs. If you have more information what you are looking for please send.
Attached you will find a specification sheet of an AirAir cooler with principle sketch. In the sketch you can find from right to left: air inlet horizontal with sound silencers, then the axial fans with back draft dampers to prevent backwards flow through the fan that is stopped, cooler tubes with longer length (3000mm) as width of generator (2610mm) and then vertical air outlet to prevent influence of wind flowing in counter direction of cooling air also with sound silencers. Inside the main casing with the tubes the air of the generator flows two times crossflow but once with counterflow to achieve a temperature approach of 15°C (difference between hot air outlet and ambient air).
The main casing has 42 tube rows vertical and 68 tubes per row with all tubes of the same length. Pitch of the tubes is rectangular that gives lower pressure loss. Has your trapezoid housing also one tube length?