Why transfer learning works or fails?