Cosmic rays propagating in interstellar space in the volume of the Milky Way interact with gas and radiation fields generating gamma ray and neutrino emissions of comparable intensity. These emissions result in diffuse fluxes of secondary particles at the Earth that encode information on the space distribution, energy spectra and mass composition of the parent CRs in the entire volume of the Galaxy, where direct detection is not possible. Extending the measurements of the diffuse gamma ray flux to very high energy (> 100 TeV) and detecting a neutrino flux above the atmospheric foreground is of great importance for our understanding of cosmic ray acceleration in Galactic sources and of the magnetic structure of the Milky Way. The study of gamma rays and neutrinos in the energy range 100 TeV-10 PeV is of particular importance because their parent particles are around the prominent spectral feature known as the "knee". The absorption probability for gamma rays in the PeV energy range distorts the energy and angular distributions of the diffuse flux, but taking into account these effects it is possible to obtain very valuable information also at these energies. In this work, starting from the CR data by direct measurements and air shower arrays, and using our model for the diffuse emission of gamma rays, we present predictions of the γ-ray flux under different hypothesis on the CR spatial and spectral distribution in the Galaxy, and compare our evaluations with the measurements in the 10 GeV-1 PeV energy range.A second point of central importance that is addressed in this paper, is the identification of the transition energy where the contribution of extragalactic cosmic rays becomes dominant. All CR particles, of both Galactic and extragalactic origin, contribute to the diffuse γ-ray and ν fluxes, but the two CR components are expected to have different space distributions and will generate diffuse fluxes that have angular distributions of different shape. This opens the possibility to identify or constrain the Galactic to extragalactic transition with observations of the γ-ray and ν diffuse fluxes. This program requires to extend the measurements of the gamma ray diffuse flux to the 10-100 PeV energy range.