You can do a search for
Code:
identifiers:"=mobi-asin:"
The mobi-asin identifier is created by calibre when it
imports an AZW3/MOBI (this only happens during the Add books process, using the first Add option*) with a non-null exth 113 field (the asin identifier). It is not saved as asin because asin creates a link to the product page on amazon.com, but the exth 113 field may be for a book from the UK or other foreign storefronts.
This is important because metadata fetching will download asin metadata

but it will never import calibre's custom mobi-asin field.
tl;dr
If a book has a mobi-asin identifier, it is pretty much guaranteed that it came from Amazon, and certainly implies that the original format was either MOBI or AZW3.
* -- The second Add option is traditionally used when adding from another library folder, it imports the metadata from the metadata.opf which overrides fetching metadata from inside the book file itself.