How one can learn to write successful cover letters and rebuttals to referees? Having a good scientific idea and writing a good paper out of it are the most important steps in order to publish in high-ranking journals, but they are not the only steps needed. The other steps are writing a good cover letter (to convince the editor) and good answers to referee reports, if needed (and this is almost always the case, based on my personal and and colleague's experience). Cover letters and rebuttals are a sort of "grey literature", in the sense that are carefully written, but not published, but only read by a few people (editors and referees). 

Therefore one can learn to write good papers by reading good papers, but one cannot learn writing good letters and rebuttals by reading them, since they are not published. 

In the light of this, how one can learn  to write successfull cover letters and rebuttals?
Your supervisor/PI/mentor should be an important source of information here. Not only will they have a lot of experience at the author end, they will also have reviewed lots of papers, and quite possibly acted as an editor. So they know what they would look for in a cover letter/rebuttal.
As Fabio Dias recommends in the comments, "Try asking people from your group/institute for the letters they sent".
Treat your cover letter/rebuttal as you would the main paper: send it to your co-authors, and if possible a trusted non-co-author, for comments and advice.
Wherever possible, try to get experience as a reviewer and (if at an appropriate stage in your career) an editor. This will help you to see things from different perspectives, and will also give you the chance to read both good and bad examples from other researchers. Even if you don't have the chance to do either of these things, try to put yourself in the editor/reviewer's position, play the devil's advocate, and think about what might persuade you if roles were reversed.