It's widely understood that the flood overtook all that had breath on earth, in what sense that Peter include the 'heavens' in the phrase 'the heavens and the earth, which are now' if the heavens didn't 'perish' with the world which was then?
Yes, there is a clear implication in this passage that the destruction of the flood was in some sense universal, including both heavens and earth.
The implication is there in the Genesis flood narrative too, Note the following verses:
We see that the destruction wasn't confined to the surface of the earth:
7So the Lord said, “I will blot out man whom I have created from the face of the land, man and animals and creeping things and birds of the heavens, for I am sorry that I have made them.” Genesis 6:7, ESV
The heavens are themselves a conduit for the destruction, and the destructive agent is delivered via them:
11In the six hundredth year of Noah's life, in the second month, on the seventeenth day of the month, on that day all the fountains of the great deep burst forth, and the windows of the heavens were opened. Genesis 7:11, ESV
The water does not merely wash over the surface but covers it, occupying much of the space previously regarded as being 'heaven' (or 'sky'):
19And the waters prevailed so mightily on the earth that all the high mountains under the whole heaven were covered. Genesis 7:19, ESV
More subtly, but more importantly, the flood narrative as a whole has strong negative echoes of the creation narrative in Genesis 1. We are invited to understand the flood as an act of uncreation (albeit partly symbolic), followed by a new creation as the waters recede and the world is repopulated. Here are a few of the most obvious examples of the parallels:
7then the Lord God formed the man of dust from the ground and breathed into his nostrils the breath of life, and the man became a living creature. Genesis 2:7, ESV
17For behold, I will bring a flood of waters upon the earth to destroy all flesh in which is the breath of life under heaven. Everything that is on the earth shall die. Genesis 6:17, ESV
22And God blessed them, saying, “Be fruitful and multiply and fill the waters in the seas, and let birds multiply on the earth.” Genesis 1:22, ESV
26Then God said, “Let us make man in our image, after our likeness. And let them have dominion over the fish of the sea and over the birds of the heavens and over the livestock and over all the earth and over every creeping thing that creeps on the earth.” Genesis 1:26, ESV
17Bring out with you every living thing that is with you of all flesh—birds and animals and every creeping thing that creeps on the earth—that they may swarm on the earth, and be fruitful and multiply on the earth.” Genesis 8:22, ESV
This helps considerably in understanding the re-creation logic of 2 Peter. Peter is attacking the scoffers who deny an impending uncreation and recreation event. He responds to…
4They will say, “Where is the promise of his coming? For ever since the fathers fell asleep, all things are continuing as they were from the beginning of creation.” 2 Peter 3:4, ESV
…with the argument that there has already been a similar uncreation/recreation event since "the beginning of creation", to which they would do well to take heed:
5For they deliberately overlook this fact, that the heavens existed long ago, and the earth was formed out of water and through water by the word of God, 6and that by means of these the world that then existed was deluged with water and perished. 7But by the same word the heavens and earth that now exist are stored up for fire, being kept until the day of judgement and destruction of the ungodly. 2 Peter 3:5-7, ESV
Note that the judgement and destruction does not stand alone, is the prelude for another creation:
12waiting for and hastening the coming of the day of God, because of which the heavens will be set on fire and dissolved, and the heavenly bodies will melt as they burn! 13But according to his promise we are waiting for new heavens and a new earth in which righteousness dwells. 2 Peter 3:12-13, ESV
Peter interprets the flood event to symbolise a full 'uncreation' and 'recreation' of the entire creation — 'the heavens and the earth' is shorthand for 'all of creation'. It is true that the flood is a less literal uncreation/recreation, but the flood narrative invites us to understand the event as having the full symbolic force.
There is also an implicit contrast between the (ineffective) water of the flood, and the (effective) 'fire' of the final judgement. Peter isn't trying to persuade the readers that the two events are equivalent, merely that the one foreshadows (and warns about) the other. The failure of the flood to cleanse the earth should lead us to expect later effective action rather than to fall into complacency — this is a common pattern of Bible logic, and is, for example, analogous to the (ineffective) law, written externally on tablets of stone, foreshadowing the (effective) law, written on the flesh of regenerate hearts.