For more than a year the COVID-19 epidemic is threatening people all over the world. Numerous researchers are looking for all possible insights into the new corona virus SARS-CoV-2. One of the possibilities is an in-depth analysis of X-ray images from COVID-19 patients, commonly conducted by a radiologist, which are due to high demand facing with overload. With the latest achievements in the field of deep learning, the approaches using transfer learning proved to be successful when tackling such problem. However, when utilizing deep learning methods, we are commonly facing the problem of hyper-parameter settings. In this research, we adapted and generalized transfer learning based classification method for detecting COVID-19 from X-ray images and employed different optimization algorithms for solving the task of hyper-parameter settings. Utilizing different optimization algorithms our method was evaluated on a dataset of 1446 X-ray images, with the overall accuracy of 84.44%, outperforming both conventional CNN method as well as the compared baseline transfer learning method. Besides quantitative analysis, we also conducted a qualitative in-depth analysis using the local interpretable model agnostic explanations method and gain some in-depth view of COVID-19 characteristics and the predictive model perception.