Several e-book managing and conversion programs should be able to convert Kindle ebooks (.azw3) to ePUB format (.epub), including the popular Calibre or Hamster converter. Such azw3 to epub conversion might only work on books that are not protected by DRM, although some programs offer removal of this as well.
Open AZW3 file Open EPUB fileA popular ebook converter
A popular ebook converter for OS X